Skip to content

Refactor rename delta table#125

Open
MrPowers wants to merge 4 commits intomainfrom
refactor-rename-delta-table
Open

Refactor rename delta table#125
MrPowers wants to merge 4 commits intomainfrom
refactor-rename-delta-table

Conversation

@MrPowers
Copy link
Owner

@MrPowers MrPowers commented Oct 2, 2023

No description provided.

@MrPowers
Copy link
Owner Author

MrPowers commented Oct 2, 2023

@danielbeach - I am getting this error:

>       spark.sql(f"ALTER TABLE {delta_table.name} RENAME TO {new_table_name}")
E       AttributeError: 'DeltaTable' object has no attribute 'name'

I'm not sure the current code works.

@danielbeach
Copy link
Collaborator

danielbeach commented Oct 2, 2023

@danielbeach - I am getting this error:

>       spark.sql(f"ALTER TABLE {delta_table.name} RENAME TO {new_table_name}")
E       AttributeError: 'DeltaTable' object has no attribute 'name'

I'm not sure the current code works.

@MrPowers Your PR looks different from the original code that's been merged. Your PR adds things like deltatable.name which doesn't work.
If you do something like deltaTable.detail() and then that has the table_name you could do something like that, but not deltatable.name

The current code is unit-tested and appears to work, do you think the unit test is inaccurate?
UPDATE: I think I see the problem, let me make a PR into this one, I think that will work,
https://github.com/MrPowers/mack/blob/main/tests/test_public_interface.py#1146

@MrPowers
Copy link
Owner Author

MrPowers commented Oct 2, 2023

@danielbeach - I don't think the current code tests databricks=True.

Co-authored-by: Daniel Beach <danielbeach@Daniels-MacBook-Pro.local>
@danielbeach
Copy link
Collaborator

@MrPowers I think the unit test was failing from another test failure, not the one concerned in this PR. I re-ran the tests locally and they passed, and re-ran the tests on this PR and they passed.

@MrPowers
Copy link
Owner Author

@danielbeach - thanks for the ping. I think you already fixed this, so closing this PR. Thanks!

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