-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug] TypeError: can not serialize 'Undefined' object
dbt=1.8.2 and databricks 1.8.0
#10270
Comments
Thanks for reaching out @thuymo87. Could you share a simple set of dbt project files to help us try to reproduce the issue you are seeing? That way we can try to isolate where that error is coming from. Something like this:
select 1 as id |
TypeError: can not serialize 'Undefined' object
dbt=1.8.2 and databricks 1.8.0
Hi dbeauty, |
Glad to hear that you were able to get it to work (even it it required downgrading to Python 3.11). Our Python compatibility matrix indicates that v1.8 supports Python 3.12, but there might be a specific edge case that you ran into within your If you are able to create a simplified model that replicate the issue in Python 3.12 and share your code, that would help us fix such an edge case. I don't know if they are related to your situation at all, but here's two other cases that got a similar error message (but each were presumably not using Python 3.12): |
Hi dbeauty10, This is published_accounts_history.sql: {{ config(
alias = 'accounts_history',
materialized='view',
tags=["published_analytics"]
) }}
SELECT
account_id,
first_currency_selection,
FROM {{ source('transformed_customers', 'accounts_history') }} And this is sources.yml: version: 2
sources:
- name: transformed_customers
database: athena_production
schema: transformed_customers
tables:
- name: accounts
- name: accounts_history Cheers |
Thanks for providing that detail, Mo. I tried to reproduce the error you got by switching to Python 3.12.3 using Do you get the same error if you simplify your {{ config(
alias = 'accounts_history',
materialized='view',
tags=["published_analytics"]
) }}
SELECT
1 as account_id,
'NZD' as first_currency_selection |
This issue has been marked as Stale because it has been open for 180 days with no activity. If you would like the issue to remain open, please comment on the issue or else it will be closed in 7 days. |
Although we are closing this issue as stale, it's not gone forever. Issues can be reopened if there is renewed community interest. Just add a comment to notify the maintainers. |
Is this a new bug in dbt-core?
Current Behavior
(myenv) monguyen@LNZM-C02DV0L3ML data_platform % dbt run -s published_accounts_history
03:15:11 Running with dbt=1.8.2
using legacy validation callback
03:15:14 Registered adapter: databricks=1.8.0
03:15:14 Unable to do partial parsing because saved manifest not found. Starting full parse.
03:15:17 Encountered an error:
can not serialize 'Undefined' object
03:15:17 Traceback (most recent call last):
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/cli/requires.py", line 138, in wrapper
result, success = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/cli/requires.py", line 101, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/cli/requires.py", line 218, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/cli/requires.py", line 247, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/cli/requires.py", line 294, in wrapper
return func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/cli/requires.py", line 320, in wrapper
ctx.obj["manifest"] = parse_manifest(
^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/parser/manifest.py", line 1898, in parse_manifest
manifest = ManifestLoader.get_full_manifest(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/parser/manifest.py", line 330, in get_full_manifest
manifest = loader.load()
^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/parser/manifest.py", line 525, in load
self.write_manifest_for_partial_parse()
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/parser/manifest.py", line 811, in write_manifest_for_partial_parse
manifest_msgpack = self.manifest.to_msgpack(extended_mashumaro_encoder)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 3, in mashumaro_to_msgpack
File "", line 85, in mashumaro_to_msgpack
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/dbt/parser/manifest.py", line 150, in extended_mashumaro_encoder
return msgpack.packb(data, default=extended_msgpack_encoder, use_bin_type=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/lib/python3.12/site-packages/msgpack/init.py", line 36, in packb
return Packer(**kwargs).pack(o)
^^^^^^^^^^^^^^^^^^^^^^^^
File "msgpack/_packer.pyx", line 294, in msgpack._cmsgpack.Packer.pack
File "msgpack/_packer.pyx", line 300, in msgpack._cmsgpack.Packer.pack
File "msgpack/_packer.pyx", line 297, in msgpack._cmsgpack.Packer.pack
File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
File "msgpack/_packer.pyx", line 231, in msgpack._cmsgpack.Packer._pack
[Previous line repeated 1 more time]
File "msgpack/_packer.pyx", line 264, in msgpack._cmsgpack.Packer._pack
File "msgpack/_packer.pyx", line 291, in msgpack._cmsgpack.Packer._pack
TypeError: can not serialize 'Undefined' object
Expected Behavior
It should create a table with command: dbt run -s published_accounts_history
Steps To Reproduce
(1) In python virtual environment, run "dbt debug" and all check passed:
03:14:35 Running with dbt=1.8.2
03:14:35 dbt version: 1.8.2
03:14:35 python version: 3.12.3
03:14:35 python path: /Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/myenv/bin/python
03:14:35 os info: macOS-14.5-x86_64-i386-64bit
using legacy validation callback
03:14:37 Using profiles dir at /Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform
03:14:37 Using profiles.yml file at /Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/profiles.yml
03:14:37 Using dbt_project.yml file at /Users/monguyen/Documents/GitHub/data-platform-airflow-v2/dp_airflow/dbt/data_platform/dbt_project.yml
03:14:37 adapter type: databricks
03:14:37 adapter version: 1.8.0
03:14:38 Configuration:
03:14:38 profiles.yml file [OK found and valid]
03:14:38 dbt_project.yml file [OK found and valid]
03:14:38 Required dependencies:
03:14:38 - git [OK found]
03:14:38 Connection:
03:14:38 host:.........
03:14:38 http_path: /sql/1.0/warehouses/500xx
03:14:38 catalog: main
03:14:38 schema: test_mo
03:14:38 Registered adapter: databricks=1.8.0
03:14:48 Connection test: [OK connection ok]
03:14:48 All checks passed!
(2) Run "dbt run -s published_accounts_history " and it show error:
"03:15:14 Unable to do partial parsing because saved manifest not found. Starting full parse.
03:15:17 Encountered an error:
can not serialize 'Undefined' object"
Relevant log output
Environment
Which database adapter are you using with dbt?
other (mention it in "Additional Context")
Additional Context
Running dbt model from local to create table on Databricks
The text was updated successfully, but these errors were encountered: