ferruzzi commented on code in PR #58248:
URL: https://github.com/apache/airflow/pull/58248#discussion_r2564076313
##########
airflow-core/src/airflow/models/serialized_dag.py:
##########
@@ -470,6 +578,15 @@ def write_dag(
log.debug("Writing Serialized DAG: %s to the DB", dag.dag_id)
new_serialized_dag.dag_version = dagv
session.add(new_serialized_dag)
+ session.flush()
+
+ if new_serialized_dag.data:
Review Comment:
That isn't the case.
```
(Pdb) new_serialized_dag.data
{'__version': 3, 'dag': {'timezone': 'UTC', 'dag_id':
'unique_deadline_one_of_two1', 'deadline': [{'__type': 'deadline_alert',
'__var': {'reference': {'reference_type': 'FixedDatetimeDeadline', 'datetime':
334720800.0}, 'interval': 0.0, 'callback_def': {'__classname__':
'airflow.sdk.definitions.callback.AsyncCallback', '__version__': 0, '__data__':
{'path':
'airflow.providers.slack.notifications.slack_webhook.SlackWebhookNotifier',
'kwargs': {'text': 'Deadline in the past; Alert should trigger
immediately!'}}}}}], 'timetable': {'__type':
'airflow.timetables.simple.NullTimetable', '__var': {}}, 'task_group':
{'_group_id': None, 'group_display_name': '', 'prefix_group_id': True,
'tooltip': '', 'ui_color': 'CornflowerBlue', 'ui_fgcolor': '#000', 'children':
{'sleep_task': ['operator', 'sleep_task']}, 'upstream_group_ids': [],
'downstream_group_ids': [], 'upstream_task_ids': [], 'downstream_task_ids':
[]}, 'fileloc': '/files/dags/min_test.py', 'relative_fileloc': 'min_test.py',
'_proc
essor_dags_folder': '/files/dags', 'tasks': [{'__var': {'template_ext':
['.sh', '.bash'], 'task_id': 'sleep_task', 'template_fields_renderers':
{'op_args': 'py', 'op_kwargs': 'py', 'bash_command': 'bash', 'env': 'json'},
'task_type': '_BashDecoratedOperator', 'ui_color': '#f0ede4',
'_needs_expansion': False, 'retry_delay': 300.0, 'template_fields': ['op_args',
'op_kwargs', 'bash_command', 'env', 'cwd'], 'python_callable_name':
'unusual_prefix_7d24d61be9ab5948cfe25dbec5024b513ba011f3_min_test.sleep_10_secs',
'_task_module': 'airflow.providers.standard.decorators.bash',
'_operator_name': '@task.bash', 'op_args': [], 'op_kwargs': {}, 'bash_command':
'DYNAMIC (set during execution)'}, '__type': 'operator'}], 'dag_dependencies':
[], 'edge_info': {}, 'params': []}}
```
```
(Pdb) new_serialized_dag.data_compressed
*** AttributeError: 'SerializedDagModel' object has no attribute
'data_compressed'. Did you mean: '_data_compressed'?
```
```
(Pdb) from airflow.configuration import conf ; conf.getboolean("core",
"compress_serialized_dags", fallback=False)
True
```
```
(Pdb) import os ; os.environ.get("AIRFLOW__CORE__COMPRESS_SERIALIZED_DAGS")
'True'
```
Did I break something?
--
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]