mszpot-future-processing commented on issue #41306:
URL: https://github.com/apache/airflow/issues/41306#issuecomment-2275165669
I rewrote the script:
```
def lag_tasks_with_filter(
channel,
demo,
window_size,
lag_week,
filter_col,
lag_task_role,
intermittent_data_location,
playground_bucket
):
return GlueJobOperator(
task_id=f"create_lags_task_{channel}_{demo}_w{window_size}_lag{lag_week}_filter{filter_col}",
job_name=config.generate_job_name(f"lag{lag_week}-weeks{window_size}-" +
f"filter{filter_col}-job-{channel}-{demo}"),
script_location=config.get_bridge_script("lags_bridge_script.py"),
iam_role_name=lag_task_role,
script_args={
"--lagWithCatPath":
f"s3://{intermittent_data_location}/output/with_cat" +
f"/channel={channel}/demographic={demo}",
"--rawDataInputPath":
f"s3://{playground_bucket}/output/oneyear" +
f"/channel={channel}/demographic_code={demo}/",
"--numberOfLagWeeks": str(lag_week),
"--windowSizeWeeks": str(window_size),
"--filterCol": filter_col,
"--taskId":
f"create_lags_task_{channel}_{demo}_w{window_size}_lag{lag_week}_filter{filter_col}",
},
create_job_kwargs={
"WorkerType": "G.2X",
"NumberOfWorkers": 5,
"GlueVersion": "4.0",
"DefaultArguments": {
"--job-language": "python",
"--enable-job-insights": "true",
"--enable-metrics": "true",
"--enable-auto-scaling": "true",
"--enable-observability-metrics":
"true",
"--TempDir":
f"s3://{config.get_environment_variable('glue_tmp_dir_location',
default_var='undefined')}",
"--extra-py-files":
config.get_asset_file_location(
"ctc_telligence_forecasting_data_product-0.0.1-py3-none-any.whl"
),
"--enable-spark-ui": "true",
"--spark-event-logs-path":
f"s3://{config.get_environment_variable('glue_spark_ui_logs_location',
default_var='undefined')}",
},
},
update_config=True,
)
@dag(dag_id='chore_task_group_stage3', schedule=None, catchup=False)
def pipeline():
ts = DummyOperator(task_id='start')
te = DummyOperator(task_id='end')
t1 = lag_tasks_with_filter.partial(lag_task_role=stage3_task_role,
intermittent_data_location=intermittent_data_location,
playground_bucket=playground_bucket).expand(channel=channels, demo=demos,
window_size=window_sizes, lag_week=lag_weeks, filter_col=filter_cols)
ts >> t1 >> te
pipeline()
```
But now getting:
```
AttributeError: 'function' object has no attribute 'partial'
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]