-
-
Notifications
You must be signed in to change notification settings - Fork 573
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
Implemented derdon's request for NotImplementedError. #801
Conversation
Used a frozenset to store VSO attributes currently supported.
@@ -213,6 +216,8 @@ def _create(wlk, root, session): | |||
DatabaseEntry.observation_time_end > start)) | |||
else: | |||
query = query.filter_by(**{typ: value}) | |||
if typ not in SUPPORTED: | |||
raise NotImplementedError("The type so requested has not been implemented yet.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These lines belong within the else-block! and the check needs to be done before the query
might be updated.
Use a better error message such as "The attribute {0!r} is not supported to query a database".format(typ)
You should not have added test.sqlite. Use |
The test.sqlite file was showing in the untracked portion...I thought I had to add it too. My bad. |
The hidden comment of me is still valid by the way. |
@derdon I think we need to modify that test so it dosen't create that file. |
Changes Unknown when pulling 976d9d9 on VaticanCameos:derdonNIError into * on sunpy:master*. |
You meant: "I think I need to modify my test so it doesn't create that file"? :P |
ssshh |
1. Changed name of frozenset to SUPPORTED_SIMPLE_VSO_ATTRS. 2. Put the raise block in proper position. 3. Changed the error message. 4. Removed test.sqlite.
Is 'starred' a supported VSO attribute? |
Starred is a supported database attibute but not a VSO one... @derdon ? |
You're right, @Cadair, Starred has nothing to do with VSO and therefore shouldn't be in the frozenset of supported VSO attributes. @vaticancameos: Adapt the check so that it says |
1. Removed 'starred' from frozenset. 2. Added check for typ.lower() for 'starred'.
1. Put 'starred' in frozenset SUPPORTED_NONVSO_ATTRS. 2. In the typ.lower() check, used a unionized set from the vso and nonvso attrs.
Changes Unknown when pulling cb945f5 on VaticanCameos:derdonNIError into * on sunpy:master*. |
Implemented derdon's request for NotImplementedError.
Used a frozenset to store VSO attributes currently supported.