Please check the BaseRawToMDMTransformer for the required arguments and methods.
Example
fromrtdip_sdk.pipelines.transformersimportERCOTToMDMTransformerfromrtdip_sdk.pipelines.utilitiesimportSparkSessionUtility# Not required if using Databricksspark=SparkSessionUtility(config={}).execute()ercot_to_mdm_transformer=ERCOTToMDMTransformer(spark=spark,data=df,output_type="usage",name=None,description=None,value_type=None,version=None,series_id=None,series_parent_id=None)result=ercot_to_mdm_transformer.transform()
Source code in src/sdk/python/rtdip_sdk/pipelines/transformers/spark/iso/ercot_to_mdm.py
classERCOTToMDMTransformer(BaseRawToMDMTransformer):""" Converts ERCOT Raw data into Meters Data Model. Please check the BaseRawToMDMTransformer for the required arguments and methods. Example -------- ```python from rtdip_sdk.pipelines.transformers import ERCOTToMDMTransformer from rtdip_sdk.pipelines.utilities import SparkSessionUtility # Not required if using Databricks spark = SparkSessionUtility(config={}).execute() ercot_to_mdm_transformer = ERCOTToMDMTransformer( spark=spark, data=df, output_type="usage", name=None, description=None, value_type=None, version=None, series_id=None, series_parent_id=None ) result = ercot_to_mdm_transformer.transform() ``` """spark:SparkSessiondata:DataFrameinput_schema=ERCOT_SCHEMAuid_col="variable"series_id_col="'series_std_001'"timestamp_col="to_utc_timestamp(StartTime, 'America/Chicago')"interval_timestamp_col="Timestamp + INTERVAL 1 HOURS"value_col="value"series_parent_id_col="'series_parent_std_001'"name_col="'ERCOT API'"uom_col="'mwh'"description_col="'ERCOT data pulled from ERCOT ISO API'"timestamp_start_col="StartTime"timestamp_end_col="StartTime + INTERVAL 1 HOURS"time_zone_col="'America/Chicago'"version_col="'1'"series_type=SeriesType.Hourmodel_type=ModelType.Defaultvalue_type=ValueType.Usageproperties_col="null"def_pre_process(self)->DataFrame:df:DataFrame=super(ERCOTToMDMTransformer,self)._pre_process()df=melt(df,id_vars=["Date","HourEnding","DstFlag"],value_vars=["Coast","East","FarWest","North","NorthCentral","SouthCentral","Southern","West","SystemTotal",],)df=df.withColumn("StartTime",F.expr("Date + MAKE_INTERVAL(0,0,0,0,cast(split(HourEnding,':')[0] as integer),0,0)"),)returndf