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

Fix limit integration (fixes #237) #256

Merged
merged 26 commits into from
Jun 4, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ Changes:
- Add reference link to ReadTheDocs URL of `Weaver` in API landing page.
- Add references to `OGC-API Processes` requirements and recommendations for eventual conformance listing
(relates to `#231 <https://github.com/crim-ca/weaver/issues/231>`_).
- Add datetime parameters for job searches queries
(relates to `#236 <https://github.com/crim-ca/weaver/issues/236>`_).
- Add limit validation and integration for jobs in retrieve queries
(relates to `#237 <https://github.com/crim-ca/weaver/issues/237>`_).
trapsidanadir marked this conversation as resolved.
Show resolved Hide resolved

Fixes:
------
Expand Down
14 changes: 8 additions & 6 deletions weaver/wps_restapi/swagger_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,11 +235,13 @@ class URL(ExtendedSchemaNode):

class DateTimeInterval(ExtendedSchemaNode):
schema_type = String
description = "DateTime format against OGC-API - Processes,\
to get values before a certain date-time use '../' before the date-time,\
to get values after a certain date-time use '/..' after the date-time like the example,\
to get values between two date-times use '/' between the date-times,\
to get values with a specific date-time just pass the datetime."
description = (
"DateTime format against OGC-API - Processes,\
to get values before a certain date-time use '../' before the date-time,\
to get values after a certain date-time use '/..' after the date-time like the example,\
to get values between two date-times use '/' between the date-times,\
to get values with a specific date-time just pass the datetime."
trapsidanadir marked this conversation as resolved.
Show resolved Hide resolved
)
example = "2022-03-02T03:32:38.487000+00:00/.."
regex_datetime = r"(\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(\.\d+)?(([+-]\d\d:\d\d)|Z)?)"
regex_interval_closed = r"{i}\/{i}".format(i=regex_datetime)
Expand Down Expand Up @@ -3526,7 +3528,7 @@ def service_api_route_info(service_api, settings):

def datetime_interval_parser(datetime_interval):
trapsidanadir marked this conversation as resolved.
Show resolved Hide resolved
# type: (str) -> DatetimeIntervalType
"""This function parse a given datetime or interval into a dictionary that will be easy for database process"""
"""This function parses a given datetime or interval into a dictionary that will be easy for database process."""
parsed_datetime = {}

if datetime_interval.startswith(DATETIME_INTERVAL_OPEN_START_SYMBOL):
Expand Down