-
Notifications
You must be signed in to change notification settings - Fork 9
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
Create load_data and load_schema APIs [RHELDST-4862] #19
Create load_data and load_schema APIs [RHELDST-4862] #19
Conversation
f9972d4
to
b112aeb
Compare
b112aeb
to
51507d3
Compare
b3cd75e
to
90df90a
Compare
90df90a
to
4d85878
Compare
fc33bef
to
29e374d
Compare
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.
Could you comment about the release of this - do you want it to be released immediately once it's approved?
Well, progress on release-engineering/exodus-lambda#116 and merging of https://gitlab.cee.redhat.com/cdn/cdn-definitions-private/-/merge_requests/6 will be blocked until a new release of cdn-definitions lands in PyPI. I still need to add the schemas (etc) though, and I don't want to burden you (? I don't think I can release this) with several releases, so I will add the schemas first--I think the release can wait until the schemas have been merged. |
d3e99c2
to
a9239a0
Compare
a9239a0
to
a21c4d8
Compare
Sorry, @nathanegillett @lipoja - I neglected to CC you here earlier. Again, I cannot add either of you as a reviewer. |
The load_schema API allows clients to more easily consume the schema.json file that is included in the cdn-definitions package. The load_data API will return a raw dictionary of the chosen data file. This will allow users to access various types of data in a uniform way. In order to encourage a single, consistent method of access to the cdn-definitions data, the legacy access methods and related classes (i.e., PathAlias, rhui_alias, and origin_alias) will be deprecated. A dedicated Python object will no longer need to be created for each new addition to the schema. The load_data API also includes an optional "source" argument to the load_data method. The source parameter allows the user to specify the source of the cdn_definitions JSON or YAML data file. The source could be a URL or a local path in a directory tree. If a source is not specified, the location may be overriden via the CDN_DEFINITIONS_PATH environment variable, which also may either be in the form of a URL or a local path. If neither a source is specified, nor a CDN_DEFINITIONS_PATH environment variable is set, the data.yaml file included in the cdn-definitions package will be used as a source. If that file is unavailable, load_data will attempt to load data from /usr/share/cdn-definitions/data.yaml. If all of the sources are invalid, a RuntimeError will be thrown.
a21c4d8
to
ea404ab
Compare
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.
Any reasons not to submit this yet? (Doesn't have to be released yet.)
The load_schema API allows clients to more easily consume the
schema.json file that is included in the cdn-definitions package.
The load_data API will return a raw dictionary of the chosen data
file. This will allow users to access various types of data in a
uniform way.
In order to encourage a single, consistent method of access to
the cdn-definitions data, the legacy access methods and related
classes (i.e., PathAlias, rhui_alias, and origin_alias) will be
deprecated. A dedicated Python object will no longer need to be
created for each new addition to the schema.
The load_data API also includes an optional "source" argument to
the load_data method. The source parameter allows the user to
specify the source of the cdn_definitions JSON or YAML data file.
The source could be a URL or a local path in a directory tree.
If a source is not specified, the location may be overriden via the
CDN_DEFINITIONS_PATH environment variable, which also may either
be in the form of a URL or a local path.
If neither a source is specified, nor a CDN_DEFINITIONS_PATH
environment variable is set, the data.yaml file included in the
cdn-definitions package will be used as a source. If that file is
unavailable, load_data will attempt to load data from
/usr/share/cdn-definitions/data.yaml. If all of the sources are
invalid, a RuntimeError will be thrown.