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

dbt-bigquery batch_id config #3718

Closed
1 task done
dbeatty10 opened this issue Jul 12, 2023 · 2 comments · Fixed by #4431
Closed
1 task done

dbt-bigquery batch_id config #3718

dbeatty10 opened this issue Jul 12, 2023 · 2 comments · Fixed by #4431
Assignees
Labels
content Improvements or additions to content dbt-core v1.7 Docs impact for the v1.7 release (Oct 2023)

Comments

@dbeatty10
Copy link
Contributor

dbeatty10 commented Jul 12, 2023

Contributions

  • I am a PM or subject matter expert at dbt who is responsible for this feature.

Where does this content belong?

https://docs.getdbt.com/reference/resource-configs/bigquery-configs

Link to source material

Here is the relevant issue & pull request:

dbt-labs/dbt-bigquery#671 / dbt-labs/dbt-bigquery#804 (review)

Additional context

None of the following needs to be documented, but for completeness sake:

To get dbt-bigquery is in a solid state for the RC for 1.6 and to avoid the issue described in dbt-labs/dbt-bigquery#822, we used dbt-labs/dbt-bigquery#826 to revert the original PR in dbt-labs/dbt-bigquery#727.

@dbeatty10 dbeatty10 added content Improvements or additions to content dbt-core v1.6 Docs impact for the v1.6 release (July 2023) labels Jul 12, 2023
@dbeatty10 dbeatty10 added this to the dbt Core v1.6 Documentation milestone Jul 12, 2023
@dbeatty10 dbeatty10 added the blocked_by_dev Awaiting merge of PR with associated functionality label Jul 13, 2023
@dbeatty10 dbeatty10 added idea Proposes an idea for new content and removed dbt-core v1.6 Docs impact for the v1.6 release (July 2023) labels Jul 14, 2023
@dbeatty10 dbeatty10 removed this from the dbt Core v1.6 Documentation milestone Jul 14, 2023
@dbeatty10 dbeatty10 added dbt-core v1.7 Docs impact for the v1.7 release (Oct 2023) and removed blocked_by_dev Awaiting merge of PR with associated functionality labels Jul 31, 2023
@nickozilla
Copy link

nickozilla commented Aug 1, 2023

This is how we would likely use batch_id param in our python models - using an env var that is only present in our CICD environment as a conditional, else use the run start time, suffixed by the model name. This should ensure that the batch ID's are always unique and compliant against the dataproc batch ID naming conventions:

models:
  - name: technical_python_array
    description: A random table with a calculated column defined in python.
    config:
      enabled: true
      batch_id: |
        {%- if env_var('CICD_BUILD_ID', '') != '' -%} {{ env_var('CICD_BUILD_ID') }}-python-array
        {%- else -%} {{ run_started_at.strftime("%Y-%m-%d-%H-%M") }}-python-array
        {%- endif -%}
    columns:
      - name: A
        description: Column A
      - name: B
        description: Column B
      - name: C
        description: Column C

@matthewshaver matthewshaver self-assigned this Oct 12, 2023
@dbeatty10 dbeatty10 removed the idea Proposes an idea for new content label Oct 23, 2023
@matthewshaver
Copy link
Contributor

Added this as part of #4431 to the existing examples.
I've opened a separate issue for us to address the need for more documentation of dataproc_batch #4433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
content Improvements or additions to content dbt-core v1.7 Docs impact for the v1.7 release (Oct 2023)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants