Use assert_true() to help Spark give us a more helpful error message, if the user has supplied a date/timestamp that is not real (returns null when cast to date or timestamp).
Compilation Error in model bad_date_spine (models/bad_date_spine.sql)
'<=' not supported between instances of 'NoneType' and 'int'
> in macro generate_series (macros/sql/generate_series.sql)
> called by macro date_spine (macros/datetime/date_spine.sql)
> called by macro get_powers_of_two (macros/sql/generate_series.sql)
> called by model bad_dateadd (models/bad_date_spine.sql)
New error:
Runtime Error in model bad_date_spine (models/bad_date_spine.sql)
Database Error
java.lang.RuntimeException: 'isnotnull(cast(2020-02-30 as date))' is not true!
resolves #6 cc @emilieschario
Use
assert_true()
to help Spark give us a more helpful error message, if the user has supplied a date/timestamp that is not real (returns null when cast to date or timestamp).models/bad_date_spine.sql
Old error:
New error: