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

fix: insert_overwrite updates for tables with int partitions #450

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

artem-garmash
Copy link
Contributor

Description

Fix incremental updates for tables with the insert_overwrite strategy and int partition columns when using dbt-core==1.6.3. Otherwise updates fail with:

  can only concatenate str (not "NoneType") to str
  
  > in macro materialization_incremental_athena (macros/materializations/models/incremental/incremental.sql)
  > called by ...

The root cause is exactly as in #425 (convert_type() returns None for int columns)
This PR adds the same workaround to delete_overlapping_partitions().

Models used to test - Optional

{{
	config(
		materialized = 'incremental',
		incremental_strategy = 'insert_overwrite',
		partitioned_by = ['m']
	)
}}

select 'val' as val, 1 as m

Checklist

  • You followed contributing section
  • You kept your Pull Request small and focused on a single feature or bug fix.
  • You added unit testing when necessary
  • You added functional testing when necessary

@artem-garmash artem-garmash changed the title fix: insert_overwrites updates for tables with int partitions fix: insert_overwrite updates for tables with int partitions Oct 10, 2023
@nicor88 nicor88 merged commit 76c4eec into dbt-labs:main Oct 10, 2023
@artem-garmash artem-garmash deleted the fix-int-partitions-update branch October 10, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants