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

🐛 Delete table creates a new database, but copies no data across #65

Open
murdo-moj opened this issue Nov 28, 2023 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@murdo-moj
Copy link
Contributor

murdo-moj commented Nov 28, 2023

Describe the bug.

3 point - Carry over from https://github.com/orgs/ministryofjustice/projects/27/views/9?layout=table&pane=issue&itemId=45189302

Scenario: 2 tables are in a data product, one is deleted

Expected behaviour: New version of the data product database should be created and contain only 1 table
Actual behaviour: New version of the data product database contains no tables; data is not copied across

@murdo-moj murdo-moj added the bug Something isn't working label Nov 28, 2023
@MatMoore
Copy link
Contributor

MatMoore commented Nov 28, 2023

Have a look at CuratedDataCopier, which @LavMatt added while the original ticket was being worked on. I don't think delete table can use it as is, but ultimately it should do the same thing as this

            CuratedDataLoader(
                column_metadata=schema_for_copy.data["TableInput"]["StorageDescriptor"][
                    "Columns"
                ],
                table=QueryTable(
                    database=schema_for_copy.database_name,
                    name=schema_for_copy.table_name,
                ),
                table_path=self.new_curated_data_product_path.replace(
                    self.schema.table_name, table
                ),
                athena_client=self.athena_client,
                glue_client=self.glue_client,
                logger=self.logger,
            ).create_new_major_version_data_product_table(
                is_updated_table=(table == self.schema.table_name)
            )

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
Status: Done ✅
Development

No branches or pull requests

2 participants