Skip to content
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] dbt_utils.date_spine gives Python error #873

Open
2 tasks done
hazvk opened this issue Mar 8, 2024 · 3 comments
Open
2 tasks done

[Bug] dbt_utils.date_spine gives Python error #873

hazvk opened this issue Mar 8, 2024 · 3 comments
Labels
bug Something isn't working triage

Comments

@hazvk
Copy link

hazvk commented Mar 8, 2024

Is this a new bug in dbt-core?

  • I believe this is a new bug in dbt-core
  • I have searched the existing issues, and I could not find an existing issue for this bug

Current Behavior

Running this model and using dbt_utils.date_spine used to work. I now get an error I can't get to the bottom of.

Expected Behavior

Should evaluate and give a table

Steps To Reproduce

With dbt on local machine:

  1. Define model as per below


{{
    config(
        materialized = "view" if target.name not in ['prod'] else 'table'
    )
}}




WITH date_list AS
(
{{ dbt_utils.date_spine(
datepart="day",
start_date="TO_DATE('01/01/2008', 'dd/mm/yyyy')",
end_date="TO_DATE(CONCAT(YEAR(CURRENT_DATE) + 6,'-12-31'))"
)
}}

)

SELECT
*
FROM date_list;
  1. Install the following packages
databricks-sdk = "==0.17.0"
dbt-databricks = "==1.6.8"
  1. Run dbt build -f

Relevant log output

Snippet

01:09:20  Completed with 1 error and 0 warnings:
01:09:20  
01:09:20    Compilation Error in model dim_date (dbt_demo/models/XXX/datamarts/customer_service/dim_date.sql)
  int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
  
  > in macro default__get_intervals_between (macros/sql/date_spine.sql)
  > called by macro get_intervals_between (macros/sql/date_spine.sql)
  > called by macro default__date_spine (macros/sql/date_spine.sql)
  > called by macro date_spine (macros/sql/date_spine.sql)
  > called by model dim_date (dbt_demo/models/adventureworks/datamarts/customer_service/dim_date.sql)

Environment

- OS: MacOS 14.3 (23D56) Sonoma
- Python: 3.10.2
- dbt: 1.6.10

Which database adapter are you using with dbt?

other (mention it in "Additional Context")

Additional Context

Using dbt-databricks==1.6.8

Last seen working on Jan 24th. Then another issue came up that I only just resolved, per issue (and hence why I fixed version of databricks-sdk). I haven't tested this functionality until yesterday, which is when I first noticed it was broken.

@hazvk hazvk added bug Something isn't working triage labels Mar 8, 2024
@hazvk hazvk changed the title [Bug] <title> [Bug] dbt_utils.date_spine is not working as expected Mar 8, 2024
@hazvk hazvk changed the title [Bug] dbt_utils.date_spine is not working as expected [Bug] dbt_utils.date_spine gives error when using legitimately Mar 8, 2024
@hazvk hazvk changed the title [Bug] dbt_utils.date_spine gives error when using legitimately [Bug] dbt_utils.date_spine gives Python error Mar 8, 2024
@dbeatty10 dbeatty10 transferred this issue from dbt-labs/dbt-core Mar 8, 2024
@vymaker
Copy link

vymaker commented Apr 10, 2024

Wondering if there is an update on the issue?

@SvenRelijveld1995
Copy link

I run into the same error, also databricks 1.7.0 and dbt-core 1.7.14

@alxsbn
Copy link

alxsbn commented Jun 12, 2024

I got the issue but it's working after upgrade. My versions:

Core:
  - installed: 1.8.2
  - latest:    1.8.2 - Up to date!

Plugins:
  - spark:      1.8.0 - Up to date!
  - databricks: 1.8.1 - Up to date!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

4 participants