mack
mack copied to clipboard
Refactor rename delta table
@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 - 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 - I don't think the current code tests databricks=True
.
@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 - thanks for the ping. I think you already fixed this, so closing this PR. Thanks!