mack icon indicating copy to clipboard operation
mack copied to clipboard

Refactor rename delta table

Open MrPowers opened this issue 1 year ago • 5 comments

MrPowers avatar Oct 02 '23 14:10 MrPowers

@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 avatar Oct 02 '23 21:10 MrPowers

@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

danielbeach avatar Oct 02 '23 21:10 danielbeach

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

MrPowers avatar Oct 02 '23 22:10 MrPowers

@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.

danielbeach avatar Oct 21 '23 20:10 danielbeach

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

MrPowers avatar Oct 21 '23 22:10 MrPowers