Re: [I] EcsRunTaskOperator should cast rendered networkConfiguration template field [airflow]

2024-12-01 Thread via GitHub


github-actions[bot] commented on issue #42756:
URL: https://github.com/apache/airflow/issues/42756#issuecomment-2510325846

   This issue has been closed because it has not received response from the 
issue author.


-- 
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]



Re: [I] EcsRunTaskOperator should cast rendered networkConfiguration template field [airflow]

2024-12-01 Thread via GitHub


github-actions[bot] closed issue #42756: EcsRunTaskOperator should cast 
rendered networkConfiguration template field
URL: https://github.com/apache/airflow/issues/42756


-- 
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]



Re: [I] EcsRunTaskOperator should cast rendered networkConfiguration template field [airflow]

2024-11-24 Thread via GitHub


github-actions[bot] commented on issue #42756:
URL: https://github.com/apache/airflow/issues/42756#issuecomment-2496442748

   This issue has been automatically marked as stale because it has been open 
for 14 days with no response from the author. It will be closed in next 7 days 
if no further activity occurs from the issue author.


-- 
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]



Re: [I] EcsRunTaskOperator should cast rendered networkConfiguration template field [airflow]

2024-10-31 Thread via GitHub


o-nikolas commented on issue #42756:
URL: https://github.com/apache/airflow/issues/42756#issuecomment-2450750331

   Hey! Thanks for reaching out with this ticket.
   
   I hear your pain, but I'm not sure we want to go down the road of manually 
casting individual types where they suit each usecase best. There are a lot of 
other templated fields and we'd have to cast them all, across all operators. 
This is really what the `render_template_as_native_obj` behaviour is meant for. 
If that doesn't work for you because you have some types you _don't_ want 
casted (the ints you mentioned) then that's a bespoke/tricky spot.
   
   I think the most natural approach is one you mostly outlined about having a 
task read in the data and cast it exactly in the way that you need for your 
usecase, since again it's quite specific. It's not as unreasonable and 
unmanageable as it may look at the outset, this is a fairly common paradigm 
actually, we use it all the time in our dags. You can wrap the data extractor 
tasks and the task they extract data for in a task group as well to reduce the 
"clutter". I mocked up this example quickly based of the dag you provided and 
it's quite clean in the code and the airflow UI:
   
   ```python
   with DAG(
   dag_id='test_dag',  
   schedule=None,   
 
   start_date=datetime(2024, 10, 4),
 
   catchup=False,   
   render_template_as_native_obj=False
   ) as dag:  

 
   with TaskGroup(group_id='EcsRunTask') as ecs_run_task_group: 
 
   @task()
   def network_config() -> dict:
 
   return 
json.loads(Variable.get('ecs_network_configuration_json')) 

 
   test_task: Unknown  = EcsRunTaskOperator(
 
   task_id='test_task', 
 
   cluster='my-cluster',
 
   task_definition='my-task-definition',
 
   launch_type='FARGATE',   
 
   overrides={  
 
   'containerOverrides': [  
 
   {
 
   'name': 'my-container',  
 
   'environment': [ 
 
   {
 
   'name': 'ENVIRONMENT_VARIABLE_A',
 
   'value': 
'environment_variable_a_string_value'
   },   
 
   {
 
   'name': 'ENVIRONMENT_VARIABLE_B',
 
   'value': '123456789' 
 
   }
 
   ]
 
   }
 
   ]
 
   },   
 
   network_configuration=network_config()   
 
   )
 
   ``` 


-- 
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]



Re: [I] EcsRunTaskOperator should cast rendered networkConfiguration template field [airflow]

2024-10-08 Thread via GitHub


jayceslesar commented on issue #42756:
URL: https://github.com/apache/airflow/issues/42756#issuecomment-2400971745

   One fix could be making a cast here (or some private method to correctly 
cast the overrides before they are passed to the run_task call) 
https://github.com/apache/airflow/blob/main/airflow/providers/amazon/aws/operators/ecs.py#L461
 
   


-- 
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]