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

Add filepath to /metadata response #23

Merged
merged 12 commits into from
Oct 29, 2020
Merged

Conversation

rod-glover
Copy link
Contributor

@rod-glover rod-glover commented Oct 29, 2020

Resolves #22 . Also fixes python-ci test environment.

This PR changes the /metadata endpoint in the following ways:

  • make the default response, regardless of query parameters, contain min and max
  • add an optional query parameter include with the following valid values, specified as a comma-separated list:
    • units
    • filepath
  • make request an optional query parameter with the following meanings:
    • request=GetMinMax: default response
    • request=GetMinMaxWithUnits: include units in response

An example request to this revised API is /metadata.json?include=filepath,units.

This change supersedes ("deprecates" is too strong a word) the previous API definition, by effectively replacing the request parameter with the include parameter. However, the old request= style still functions as it did to ensure backward compatibility.

This PR also adds the infrastructure for building a Docker image containing an appropriate test environment for this package. It has been exercised and works as advertised. It is a minor variation of the infrastructure established for the same purpose in PyCDS.

Copy link
Contributor

@jameshiebert jameshiebert left a comment

Choose a reason for hiding this comment

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

Looks good to me!

.filter(DataFileVariableDSGTimeSeries.netcdf_variable_name == var)
)
for Table in joins:
q = q.join(Table)
Copy link
Contributor

Choose a reason for hiding this comment

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

That's a nice way to do it.

@@ -1,6 +1,7 @@
import os
from os.path import basename

from sqlalchemy.orm.exc import NoResultFound, MultipleResultsFound
Copy link
Contributor

Choose a reason for hiding this comment

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

Good use of these.

@rod-glover rod-glover merged commit 4794c0e into master Oct 29, 2020
@rod-glover rod-glover deleted the i184-metadata-filepath branch October 29, 2020 23:12
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.

Add filepath to /metadata response
2 participants