aru-trackunit commented on issue #36839:
URL: https://github.com/apache/airflow/issues/36839#issuecomment-1914628927
@Joffreybvn Just retested with `Databricks provider 6.1.0` on `airflow
2.8.1` and the issue still persists with different stacktrace:
```
[2024-01-29, 13:41:53 CET] {taskinstance.py:1956} INFO - Dependencies all
met for dep_context=non-requeueable deps ti=<TaskInstance: task_1.read
manual__2024-01-29T13:41:35+01:00 [queued]>
[2024-01-29, 13:41:53 CET] {taskinstance.py:1956} INFO - Dependencies all
met for dep_context=requeueable deps ti=<TaskInstance: task_1.read
manual__2024-01-29T13:41:35+01:00 [queued]>
[2024-01-29, 13:41:53 CET] {taskinstance.py:2170} INFO - Starting attempt 1
of 1
[2024-01-29, 13:41:53 CET] {taskinstance.py:2191} INFO - Executing
<Task(DatabricksSqlOperator): read> on 2024-01-29 12:41:35+00:00
[2024-01-29, 13:41:53 CET] {standard_task_runner.py:60} INFO - Started
process 131 to run task
[2024-01-29, 13:41:53 CET] {standard_task_runner.py:87} INFO - Running:
['airflow', 'tasks', 'run', 'task_1', 'read',
'manual__2024-01-29T13:41:35+01:00', '--job-id', '6', '--raw', '--subdir',
'DAGS_FOLDER/dag-wn-equipment.py', '--cfg-path', '/tmp/tmpq_30xj_j']
[2024-01-29, 13:41:53 CET] {standard_task_runner.py:88} INFO - Job 6:
Subtask read
[2024-01-29, 13:41:53 CET] {task_command.py:423} INFO - Running
<TaskInstance: task_1.read manual__2024-01-29T13:41:35+01:00 [running]> on host
33e1fb1e4ed5
[2024-01-29, 13:41:53 CET] {taskinstance.py:2480} INFO - Exporting env vars:
AIRFLOW_CTX_DAG_OWNER='team_analytics' AIRFLOW_CTX_DAG_ID='task_1'
AIRFLOW_CTX_TASK_ID='read'
AIRFLOW_CTX_EXECUTION_DATE='2024-01-29T12:41:35+00:00'
AIRFLOW_CTX_TRY_NUMBER='1'
AIRFLOW_CTX_DAG_RUN_ID='manual__2024-01-29T13:41:35+01:00'
[2024-01-29, 13:41:53 CET] {sql.py:276} INFO - Executing: SELECT * FROM
catalog.schema.test_table LIMIT 10;
[2024-01-29, 13:41:53 CET] {base.py:83} INFO - Using connection ID
'tu-databricks-sp' for task execution.
[2024-01-29, 13:41:54 CET] {databricks_base.py:514} INFO - Using Service
Principal Token.
[2024-01-29, 13:41:54 CET] {databricks_base.py:223} INFO - Existing Service
Principal token is expired, or going to expire soon. Refreshing...
[2024-01-29, 13:41:54 CET] {databricks_base.py:514} INFO - Using Service
Principal Token.
[2024-01-29, 13:41:55 CET] {client.py:200} INFO - Successfully opened
session 01eebea3-c8a3-1606-b957-b38c0426a2d7
[2024-01-29, 13:41:55 CET] {sql.py:450} INFO - Running statement: SELECT *
FROM catalog.schema.test_table LIMIT 10, parameters: None
[2024-01-29, 13:41:57 CET] {client.py:258} INFO - Closing session
01eebea3-c8a3-1606-b957-b38c0426a2d7
[2024-01-29, 13:41:57 CET] {xcom.py:664} ERROR - Object of type tuple is not
JSON serializable. If you are using pickle instead of JSON for XCom, then you
need to enable pickle support for XCom in your airflow config or make sure to
decorate your object with attr.
[2024-01-29, 13:41:57 CET] {taskinstance.py:2698} ERROR - Task failed with
exception
Traceback (most recent call last):
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/utils/json.py", line
91, in default
return serialize(o)
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/serialization/serde.py",
line 147, in serialize
return encode(classname, version, serialize(data, depth + 1))
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/serialization/serde.py",
line 126, in serialize
return [serialize(d, depth + 1) for d in o]
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/serialization/serde.py",
line 126, in <listcomp>
return [serialize(d, depth + 1) for d in o]
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/serialization/serde.py",
line 126, in serialize
return [serialize(d, depth + 1) for d in o]
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/serialization/serde.py",
line 126, in <listcomp>
return [serialize(d, depth + 1) for d in o]
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/serialization/serde.py",
line 180, in serialize
raise TypeError(f"cannot serialize object of type {cls}")
TypeError: cannot serialize object of type <class
'airflow.providers.databricks.hooks.databricks_sql.Row'>
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/models/taskinstance.py",
line 440, in _execute_task
task_instance.xcom_push(key=XCOM_RETURN_KEY, value=xcom_value,
session=session)
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/utils/session.py",
line 76, in wrapper
return func(*args, **kwargs)
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/models/taskinstance.py",
line 2980, in xcom_push
XCom.set(
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/utils/session.py",
line 76, in wrapper
return func(*args, **kwargs)
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/models/xcom.py",
line 247, in set
value = cls.serialize_value(
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/models/xcom.py",
line 662, in serialize_value
return json.dumps(value, cls=XComEncoder).encode("UTF-8")
File "/usr/local/lib/python3.10/json/__init__.py", line 238, in dumps
**kw).encode(obj)
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/utils/json.py", line
102, in encode
o = self.default(o)
File
"/home/airflow/.local/lib/python3.10/site-packages/airflow/utils/json.py", line
93, in default
return super().default(o)
File "/usr/local/lib/python3.10/json/encoder.py", line 179, in default
raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type tuple is not JSON serializable
[2024-01-29, 13:41:57 CET] {taskinstance.py:1138} INFO - Marking task as
FAILED. dag_id=task_1, task_id=read, execution_date=20240129T124135,
start_date=20240129T124153, end_date=20240129T124157
[2024-01-29, 13:41:57 CET] {standard_task_runner.py:107} ERROR - Failed to
execute job 6 for task read (Object of type tuple is not JSON serializable; 131)
```
--
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]