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

to_parquet: mismatch between path and projection_storage_location_template #2666

Closed
bucefalog opened this issue Feb 9, 2024 · 1 comment
Closed
Labels
bug Something isn't working

Comments

@bucefalog
Copy link

bucefalog commented Feb 9, 2024

Describe the bug

Not sure if this should be a bug or a feature request.
When using function to_parquet with partitions and custom projection_storage_location_template, the template is ignored and files are always written to the default path ( .../partition_column=value/... ).

How to Reproduce

wr.s3.to_parquet(
    df=data,
    path=s3_folder,    # 's3//bucket/prefix/'
    dataset=True,
    database=athena_db, 
    table=table_name, 
    partition_cols= ['my_column'],
    mode='append',
    glue_table_settings={
        'regular_partitions' : False
    },
    athena_partition_projection_settings={ # this is currently not working as the wrangler hardcodes the paths
        'projection_storage_location_template' : f'{s3_folder}${{my_column}}/',
    }
)

Expected behavior

Files should be written to s3 following the provided format.
In the sample code this should be to path:
's3://bucket/prefix/VALUE/HASH.parquet'
as opposed to:
's3://bucket/prefix/my_column=VALUE/HASH.parquet'

Your project

No response

Screenshots

No response

OS

mac

Python version

3.11.4

AWS SDK for pandas version

3.5.2

Additional context

No response

@bucefalog bucefalog added the bug Something isn't working label Feb 9, 2024
@kukushking
Copy link
Contributor

Hi @bucefalog the template is only used for partition projection, unfortunately it does not impact how awswrangler creates partitions. Only Hive-style partitions are supported at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants