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

User single site #355

Merged
merged 4 commits into from
Jan 29, 2025
Merged

User single site #355

merged 4 commits into from
Jan 29, 2025

Conversation

dgitis
Copy link
Collaborator

@dgitis dgitis commented Dec 26, 2024

Description & motivation

GA4 user export tables for single-site dbt-GA4.

This PR adds base and staging models for the native user export. The main feature of these tables is the ability to unnest user properties and audiences using variables. They are disabled by default but the Readme covers the range of user tables.

Checklist

  • [ y] I have verified that these changes work locally
  • [ y] I have updated the README.md (if applicable)
  • [y ] I have added tests & descriptions to my models (and macros if applicable)
  • [y ] I have run dbt test and python -m pytest . to validate existing tests

@dgitis
Copy link
Collaborator Author

dgitis commented Dec 26, 2024

The tests don't fail on my local computer.

@adamribaudo-velir adamribaudo-velir merged commit d14736b into main Jan 29, 2025
1 of 2 checks passed
@adamribaudo-velir adamribaudo-velir deleted the user-single-site branch January 29, 2025 12:16
@adamribaudo-velir adamribaudo-velir restored the user-single-site branch January 31, 2025 11:54
@jice-lavocat
Copy link

I got a Parsing Error Unable to find model 'dbt_folder.stg_ga4__users' for unit test 'test_stg_ga4__users_audiences' in models/staging/stg_ga4__users.yml error on my local machine (here dbt_folder is the folder where my dbt project lives).

However, I have a specific setup that could explain this... but until now the tests were running fine.

@adamribaudo-velir
Copy link
Collaborator

@dgitis This is the same error that we're seeing in PR #346. dbt-core doesn't understand what to do with a unit test when the model is disabled.

Thanks for calling this out, @jice-lavocat if you enable the stg_ga4__users model, this error should go away. But that assumes you have a users table to stage.

@jice-lavocat
Copy link

jice-lavocat commented Jan 31, 2025

EDIT: now I understand your comment. The model is disabled by default.
I'll have a user model at some point now that I see this PR, but not immediately.

--

... I didn't disable this model.

In total, three unit tests are failing for me:

  • test_base_to_stg_ga4__client_keys
  • test_stg_ga4__client_keys_audiences
  • test_stg_ga4__users_audiences

I'm not up to date on unit tests, but the test test_base_to_stg_ga4__users works, so I don't know what's different with the test test_stg_ga4__users_audiences.

@dgitis
Copy link
Collaborator Author

dgitis commented Feb 3, 2025

Sorry about the late response. I saw this the morning that you posted and then totally forgot about it.

I suspect that the unit tests are failing because those modes aren't enabled. I tested whether the models work but not whether the the tests caused errors when the models aren't in use.

You should be able to disable the offending tests with the following block:

tests:
  staging:
    test_stg_ga4__users_audience:
      +enabled: false
    test_stg_ga4__client_keys_audiences:
      +enabled: false
    base:
      test_base_to_stg_ga4__client_keys:
        +enabled: false

I'm not sure if those resource paths are exactly correct. I haven't disabled tests this way but that should get you close.

I'll check disabling tests and update the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants