@@ -429,7 +429,7 @@ def clean_up_table(self, relation: AthenaRelation) -> None:
429
429
430
430
@available
431
431
def generate_unique_temporary_table_suffix (self , suffix_initial : str = "__dbt_tmp" ) -> str :
432
- return f"{ suffix_initial } _{ str (uuid4 ())} "
432
+ return f"{ suffix_initial } _{ str (uuid4 ()). replace ( '-' , '_' ) } "
433
433
434
434
def quote (self , identifier : str ) -> str :
435
435
return f"{ self .quote_character } { identifier } { self .quote_character } "
@@ -1209,22 +1209,21 @@ def _generate_snapshot_migration_sql(self, relation: AthenaRelation, table_colum
1209
1209
- Copy the content of the staging table to the final table
1210
1210
- Delete the staging table
1211
1211
"""
1212
- col_csv = f",\n { ' ' * 16 } " .join (table_columns )
1212
+ col_csv = f", \n { ' ' * 16 } " .join (table_columns )
1213
1213
staging_relation = relation .incorporate (
1214
1214
path = {"identifier" : relation .identifier + "__dbt_tmp_migration_staging" }
1215
1215
)
1216
1216
ctas = dedent (
1217
1217
f"""\
1218
1218
select
1219
- { col_csv } ,
1219
+ { col_csv } ,
1220
1220
dbt_snapshot_at as dbt_updated_at,
1221
1221
dbt_valid_from,
1222
1222
if(dbt_valid_to > cast('9000-01-01' as timestamp), null, dbt_valid_to) as dbt_valid_to,
1223
1223
dbt_scd_id
1224
1224
from { relation }
1225
1225
where dbt_change_type != 'delete'
1226
- ;
1227
- """
1226
+ ;"""
1228
1227
)
1229
1228
staging_sql = self .execute_macro (
1230
1229
"create_table_as" , kwargs = dict (temporary = True , relation = staging_relation , compiled_code = ctas )
0 commit comments