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] Column reference error in stripe__balance_transactions model #104

Open
2 of 4 tasks
cenkkiran opened this issue Jan 30, 2025 · 0 comments
Open
2 of 4 tasks
Labels
type:bug Something is broken or incorrect

Comments

@cenkkiran
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the issue

The stripe__balance_transactions model is referencing balance_transaction.created_at when the source column is actually named created, causing compilation errors in downstream models.

The error occurs in the following line of the stripe__balance_transactions model:

balance_transaction.created_at as balance_transaction_created_at,

### Relevant error log or model output

```shell
Runtime Error
Database Error in model int_stripe__date_spine (models/intermediate/int_stripe__date_spine.sql)
  column "balance_transaction_created_at" does not exist in stripe__balance_transactions

Expected behavior

The model should reference the correct source column name created instead of created_at and dbt compile should complete without any error.
The model fails to compile due to referencing a non-existent column name, causing downstream models to fail.

Possible solution

Update the line in stripe__balance_transactions.sql to:
balance_transaction.created as balance_transaction_created_at,

or make the edit within the stripe_source package

dbt Project configurations

vars:

Salesforce module variables

using_account_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_opportunity_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_user_role_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_user_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_contact_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_lead_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_task_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_event_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_product_2_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_order_history_mode_active_records: false # false by default. Only use if you have history mode enabled.
using_opportunity_line_item_history_mode_active_records: false # false by default. Only use if you have history mode enabled.

salesforce:
account: "{{ ref('stg_salesforce__account') }}"
opportunity: "{{ ref('stg_salesforce__opportunity') }}"
user: "{{ ref('stg_salesforce__user') }}"
user_role: "{{ ref('stg_salesforce__user_role') }}"
contact: "{{ ref('stg_salesforce__contact') }}"
lead: "{{ ref('stg_salesforce__lead') }}"
task: "{{ ref('stg_salesforce__task') }}"
event: "{{ ref('stg_salesforce__event') }}"
product_2: "{{ ref('stg_salesforce__product_2') }}"
order: "{{ ref('stg_salesforce__order') }}"
opportunity_line_item: "{{ ref('stg_salesforce__opportunity_line_item') }}"

salesforce__account_pass_through_columns:
- name: "region_c"
- name: "csm_c"
- name: "funding_c"
- name: "created_date"
alias: "account_created_date"
- name: "target_account_c"
- name: "territory_c"
- name: "renewal_date_c"
- name: "number_of_ds_c"
- name: "target_account_tier_c"
- name: "sdr_c"
- name: "comet_organization_id_c"
- name: "account_status_c"
- name: "ml_ops_c"
- name: "x_6_sense_account_6_qa_end_date_c"
- name: "x_6_sense_account_6_qa_start_date_c"
- name: "x_6_sense_account_intent_score_c"
- name: "x_6_sense_account_segments_c"
- name: "x_6_sense_account_reach_score_c"
- name: "x_6_sense_6_qa_c"
- name: "x_6_sense_account_profile_score_c"
- name: "x_6_sense_account_buying_stage_c"
- name: "x_6_sense_account_profile_fit_c"
- name: "enterprise_product_c"

salesforce__contact_pass_through_columns:
- name: "mkto_si_last_interesting_moment_desc_c"
alias: "last_interesting_moment"
- name: "contact_status_c"
alias: "contact_status"
- name: "mql_date_c"
alias: "mql_date"
transform_sql: "cast(mql_date as date)"
- name: created_date
- name: "bizible_2_touchpoint_source_lc_c"
alias: "bizible_touchpoint_source_lead_creation"
- name: "bizible_2_touchpoint_source_ft_c"
alias: "bizible_touchpoint_source_first_touch"
- name: "bizible_2_marketing_channel_ft_c"
alias: "bizible_marketing_channel_first_touch"
- name: "bizible_2_marketing_channel_lc_c"
alias: "bizible_marketing_channel_lead_creation"
- name: "lead_source_detail_c"
alias: "lead_source_detail"

salesforce__event_pass_through_columns:
- name: "se_c"
- name: "opportunity_c"
- name: "booked_via_c"
- name: "meeting_held_c"
- name: "initial_interest_c"
- name: "sdr_notes_c"
- name: "demo_meeting_status_c"

salesforce__opportunity_pass_through_columns:
- name: "date_to_stage_two_c"
- name: "se_c"
- name: "poc_start_date_c"
- name: "size_of_team_c"
- name: "poc_end_date_c"
- name: "opportunity_source_c"
- name: "pipeline_status_c"
- name: "use_cases_c"
- name: "contract_start_date_c"
- name: "contract_end_date_c"
- name: "date_of_discovery_call_c"
- name: "customer_level_c"
- name: "prior_year_renewal_amount_c"
- name: "data_scientists_on_first_call_c"
- name: "proposal_date_c"
- name: "renewal_created_c"
- name: "full_user_licenses_c"
- name: "view_only_licenses_c"
- name: "poc_conducted_c"
- name: "sdr_c"
alias: "opp_sdr_c"

salesforce__opportunity_line_item_pass_through_columns:
- name: "users_c"
- name: "number_of_months_c"

salesforce__task_pass_through_columns:
- name: "se_c"
- name: "disqualified_reason_c"
- name: "opportunity_c"
- name: "demo_meeting_status_c"
- name: "booked_via_c"
- name: "meeting_held_c"
- name: "initial_interest_c"
- name: "sdr_notes_c"

Stripe Variables

stripe_timezone: "America/New_York"

Package versions

packages:

  • package: fivetran/salesforce
    version: [">=1.0.0", "<1.2.0"]

  • package: dbt-labs/redshift
    version: 0.9.0

  • package: dbt-labs/codegen
    version: 0.13.1

  • package: fivetran/salesforce_formula_utils
    version: [">=0.9.0", "<0.11.0"]

  • package: fivetran/stripe
    version: [">=0.16.0", "<0.17.0"]

  • package: dbt-labs/dbt_external_tables
    version: 0.11.1

  • package: dbt-labs/dbt_utils
    version: [">=1.0.0", "<2.0.0"]

  • package: calogica/dbt_expectations
    version: [">=0.10.0", "<0.11.0"]

What database are you using dbt with?

redshift

How are you running this dbt package?

dbt Core™, Fivetran Transformations

dbt Version

Core:

  • installed: 1.8.6
  • latest: 1.9.2 - Update available!

Your version of dbt-core is out of date!
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Plugins:

  • redshift: 1.8.1 - Update available!
  • postgres: 1.8.2 - Update available!

At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation

Additional Context

This issue affects any downstream models that depend on the balance_transaction_created_at column from the stripe__balance_transactions model.

Are you willing to open a PR to help address this issue?

  • Yes.
  • Yes, but I will need assistance.
  • No.
@cenkkiran cenkkiran added the type:bug Something is broken or incorrect label Jan 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something is broken or incorrect
Projects
None yet
Development

No branches or pull requests

1 participant