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

Fix issues related to having catalog_name in identifier #964

Merged
merged 3 commits into from
Jul 26, 2024

Conversation

HonahX
Copy link
Contributor

@HonahX HonahX commented Jul 25, 2024

An attempt to fix #742 without removing the catalog_name. This may serve as a temporary solution if we finally decide to
do #963 in a later release (or not remove). Otherwise #963 should be preferred

@HonahX HonahX changed the title [WIP] Fix issues related to having catalog_name in identifier Fix issues related to having catalog_name in identifier Jul 25, 2024
# specific language governing permissions and limitations
# under the License.
# pylint:disable=redefined-outer-name
from typing import List, Optional, Union
Copy link
Contributor Author

@HonahX HonahX Jul 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may be moved to test_writes.py Putting it here temporarily.

@@ -1226,3 +1226,25 @@ def test_catalog_from_parameters_empty_env(rest_mock: Mocker) -> None:

catalog = cast(RestCatalog, load_catalog("production", uri="https://other-service.io/api"))
assert catalog.uri == "https://other-service.io/api"


def test_commit_table_fail(rest_mock: Mocker, example_table_metadata_v2: Dict[str, Any]) -> None:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: I find the name of this test confusing as it sounds like we are expecting the table commit to fail, but it succeeds with a 200 status code within the test

@sungwy
Copy link
Collaborator

sungwy commented Jul 25, 2024

+1 to this solution for 0.7.0 @HonahX . This is a creative way to mitigate the issue for the release in the short term. Thank you for taking your time to put together this solution so quickly!

Copy link
Contributor

@kevinjqliu kevinjqliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this workaround keeps the catalog name (self.name) as part of the TableIdentifier and removes it when interacting with the REST server.

LGTM!

@HonahX HonahX marked this pull request as ready for review July 26, 2024 06:55
Copy link
Collaborator

@sungwy sungwy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmed that the fix works with the rust REST Catalog

@sungwy sungwy merged commit 0213dab into apache:main Jul 26, 2024
7 checks passed
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.

Rest Catalog: catalog.name should not be part of namespace
4 participants