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

[uss_qualifier] add utility properties to QueryError #536

Merged
merged 1 commit into from
Mar 12, 2024

Conversation

Shastick
Copy link
Contributor

@Shastick Shastick commented Mar 8, 2024

A QueryError often wrap a single query, of which it is common to check the status code.

Additionally, when a check fails, we're interested in the wrapped queries' timestamps.

This PR adds a last_status_code and query_timestamps method to QueryError to make these use cases easier.

Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

I believe that the convention was that the "main" query is actually the first one, at least that what I did in some tests, and I don't believe I saw other examples of that (but there may be). Not great if we have two conventions.
IMO we would be better of introducing the convention (part of the class contract) that we have one single relevant query (then we can just have status_code e.g.), and offer the possibly of adding additional 'FYI' queries. I don't think that would break anything. WDYT?

@Shastick
Copy link
Contributor Author

That makes sense, though I'm happy to say that the first query would be the 'main' one, and to reflect that in the various utility methods.

If this is properly documented (such as through a comment or well-named utility functions) I'd be fine with it.

I'll see if I can come up with something simple.

@Shastick Shastick force-pushed the query-error-utils branch from ad7d8ac to 6c6ec14 Compare March 12, 2024 16:05
Copy link
Contributor

@mickmis mickmis left a comment

Choose a reason for hiding this comment

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

Nice LGTM

@mickmis mickmis merged commit 91dffe2 into interuss:main Mar 12, 2024
9 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.

2 participants