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

Better error message on conflicting dataset metadata when updating using API #9

Open
feixieliz opened this issue Nov 28, 2024 · 0 comments
Assignees

Comments

@feixieliz
Copy link

Description:

It appears that when using the client.update_dataset_metadata(request) method to update the dataset metadata, it will return the following error if the dataset already has metadata:
invariant_sdk.types.exceptions.InvariantError: Error calling method: PUT for path: /api/v1/dataset/metadata/your_dataset_name

Reproduction of the issue:

After successfully pushing traces to explorer using client.push_trace(request) and client.update_dataset_metadata(request), repeating the second command will trigger the above error.

Suggestion:

  • It would be helpful to have a specific error message just like those for error code 500, 401, 404:
    if response.status_code == 500:
    raise InvariantAPIError(
    f"Server error caused failure when calling method: {method} for path: {pathname}."
    ) from e
    if response.status_code == 401:
    raise InvariantAuthError(
    f"Authentication failed when calling method: {method} for path: {pathname}."
    ) from e
    if response.status_code == 404:
    This one returns 403.
  • Add a feature to overwrite the old metadata for update (such as a force=true parameter) or add a feature to delete the old metadata (supporting a DELETE request only targeting metadata) without needing to delete the whole dataset.
@Viehzeug Viehzeug self-assigned this Jan 10, 2025
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

No branches or pull requests

2 participants