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

schema_changes_from_baseline test doesn't work for Databricks #1184

Closed
ghost opened this issue Sep 28, 2023 · 1 comment
Closed

schema_changes_from_baseline test doesn't work for Databricks #1184

ghost opened this issue Sep 28, 2023 · 1 comment
Labels
Bug Something isn't working Triage 👀

Comments

@ghost
Copy link

ghost commented Sep 28, 2023

Describe the bug
An elementary's schema_changes_from_baseline doesn't work for the Databricks delta tables. See the steps to reproduce

The test definition is in yml file (under the dbt project). Note WRONG_TYPE for the data_type parameter was set to demo the test bug (it doesn't work for any other types such as date, timestamp etc

      - name: src_appsflyer
        external:
          location: 's3://$path'
          using: delta
        tests:
          - elementary.schema_changes_from_baseline:
              fail_on_added: true
              enforce_types: true
        columns:
          - name: advertising_id
            data_type: WRONG_TYPE

The table structure from databricks metastore

Screenshot 2023-09-28 at 2 40 22 PM

how I run the dbt test command

dbt test -s source:pa.src_appsflyer --target prod

What’s the command output

07:29:47  Running 1 on-run-start hook
07:29:48  1 of 1 START hook: elementary.on-run-start.0 ................................... [RUN]
07:29:48  1 of 1 OK hook: elementary.on-run-start.0 ...................................... [OK in 0.00s]
07:29:48  
07:29:49  Concurrency: 1 threads (target='prod')
07:29:49  
07:29:49  1 of 2 START test elementary_source_schema_changes_from_baseline_pa_src_appsflyer_True__True  [RUN]
07:29:56  1 of 2 PASS elementary_source_schema_changes_from_baseline_pa_src_appsflyer_True__True  [PASS in 7.43s]
07:29:56  2 of 2 START test src_appsflyer__recency ....................................... [RUN]
07:29:59  2 of 2 PASS src_appsflyer__recency ............................................. [PASS in 3.35s]
07:29:59  
07:29:59  Running 1 on-run-end hook
07:30:12  1 of 1 START hook: elementary.on-run-end.0 ..................................... [RUN]
07:30:12  1 of 1 OK hook: elementary.on-run-end.0 ........................................ [OK in 0.00s]
07:30:12  
07:30:12  
07:30:12  Finished running 2 tests, 2 hooks in 0 hours 0 minutes and 38.50 seconds (38.50s).
07:30:12  
07:30:12  Completed successfully

How I generated baseline column definition

dbt run-operation elementary.generate_schema_baseline_test --args ‘{“name”:“src_appsflyer”, “fail_on_added”: true, “enforce_types”: true}’ -t prod

Expected behavior

dbt test will fail

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Elementary version 0.10.0
dbt-core: 1.5.1
dbt-spark: 1.5.0
dbt-databricks: 1.5.4

Additional context
Add any other context about the problem here.

@ghost ghost added Bug Something isn't working Triage 👀 labels Sep 28, 2023
@haritamar
Copy link
Collaborator

Hi @Almaz-Murzabekov !
Thanks for opening this issue and sorry for the super delayed response, we are currently in the process of reviewing our open issues and improving our process there.
Elementary's schema changes tests only work in Databricks when unity catalog is being utilized (not sure if that's the case above).

In any case, since the issue has been open for over 3 months I'm going go ahead to close it - please feel free to re-open if still relevant.

Thanks!
Itamar

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

1 participant