You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Review with Product Owner:
Before implementation, confirm with the product owner whether GHGenius intensity values should remain as a separate field or be merged into a fuel_type_other value. This discussion is critical due to recent talks about potential changes in how these values are handled.
Description
The current ETL script for migrating Schedule B records to LCFS uses crsbr.intensity for records determined via GHGenius, which is insufficient. Instead, the script must obtain the correct carbon intensity from TFRS Schedule D data using the schedule_d_sheet_index value. This approach should mimic the logic in the TFRS codebase.
Task
Identify Target Section:
Locate the ETL code block handling intensity determination for records where dt.the_type equals 'GHGenius'.
WHEN dt.the_type ='GHGenius'THEN crsbr.intensity --TODO fix intensity to extract from Schedule-D sheets
Reference TFRS Code:
Use these TFRS code references as guidance:
@propertydefeffective_carbon_intensity(self):
ifself.provision_of_the_actisNone:
returnNonet=self.provision_of_the_act.determination_type.the_typeift=='GHGenius':
i=self.schedule_d_sheet_indexsheets=self.schedule.compliance_report.schedule_d.sheets.all()
returnsheets[i].carbon_intensity# ... additional logic for other determination types ...
Implementation Steps:
Join or Query Schedule D Data:
Modify the ETL script to join or query the compliance_report_schedule_d_sheet table using the compliance_report_id and the schedule_d_sheet_index from the Schedule B record.
Extract Carbon Intensity:
Retrieve the carbon intensity value from the corresponding Schedule D sheet, following the logic in ScheduleDSheet.carbon_intensity.
Replace Placeholder:
Replace the current placeholder (crsbr.intensity) with the retrieved carbon intensity value for GHGenius records.
Logging and Error Handling:
Implement detailed logging for the retrieved value and handle errors gracefully if the join or retrieval fails.
Acceptance Criteria
The ETL script correctly extracts the carbon intensity from the TFRS Schedule D sheet based on the schedule_d_sheet_index.
For records where dt.the_type is 'GHGenius', the LCFS fuel_supply.intensity field is populated with the value derived from the corresponding Schedule D sheet.
Detailed logging is implemented, and any errors in data retrieval are properly handled.
Final changes are documented and reviewed with the product owner prior to deployment.
This ticket ensures that the ETL process correctly maps and retrieves the carbon intensity value for GHGenius records by leveraging the established logic in the TFRS codebase.
The text was updated successfully, but these errors were encountered:
Review with Product Owner:
Before implementation, confirm with the product owner whether GHGenius intensity values should remain as a separate field or be merged into a
fuel_type_other
value. This discussion is critical due to recent talks about potential changes in how these values are handled.Description
The current ETL script for migrating Schedule B records to LCFS uses
crsbr.intensity
for records determined via GHGenius, which is insufficient. Instead, the script must obtain the correct carbon intensity from TFRS Schedule D data using theschedule_d_sheet_index
value. This approach should mimic the logic in the TFRS codebase.Task
Locate the ETL code block handling intensity determination for records where
dt.the_type
equals'GHGenius'
.Use these TFRS code references as guidance:
Modify the ETL script to join or query the
compliance_report_schedule_d_sheet
table using thecompliance_report_id
and theschedule_d_sheet_index
from the Schedule B record.Retrieve the carbon intensity value from the corresponding Schedule D sheet, following the logic in
ScheduleDSheet.carbon_intensity
.Replace the current placeholder (
crsbr.intensity
) with the retrieved carbon intensity value for GHGenius records.Implement detailed logging for the retrieved value and handle errors gracefully if the join or retrieval fails.
Acceptance Criteria
schedule_d_sheet_index
.dt.the_type
is'GHGenius'
, the LCFSfuel_supply.intensity
field is populated with the value derived from the corresponding Schedule D sheet.This ticket ensures that the ETL process correctly maps and retrieves the carbon intensity value for GHGenius records by leveraging the established logic in the TFRS codebase.
The text was updated successfully, but these errors were encountered: