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

Custom fields EDTF fix and CI update #550

Merged
merged 2 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 8 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,33 +31,30 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.7, 3.8, 3.9]
python-version: [3.8, 3.9]
requirements-level: [pypi]
cache-service: [redis]
db-service: [postgresql11, postgresql13, mysql5, mysql8]
search-service: [opensearch1, elasticsearch7]
db-service: [postgresql13, postgresql14, mysql8]
search-service: [opensearch2, elasticsearch7]
exclude:
- python-version: 3.7
db-service: postgresql13
db-service: postgresql14

- python-version: 3.7
db-service: mysql8

include:
- db-service: postgresql11
DB_EXTRAS: "postgresql"

- db-service: postgresql13
DB_EXTRAS: "postgresql"

- db-service: mysql5
DB_EXTRAS: "mysql"
- db-service: postgresql14
DB_EXTRAS: "postgresql"

- db-service: mysql8
DB_EXTRAS: "mysql"

- search-service: opensearch1
SEARCH_EXTRAS: "opensearch1"
- search-service: opensearch2
SEARCH_EXTRAS: "opensearch2"

- search-service: elasticsearch7
SEARCH_EXTRAS: "elasticsearch7"
Expand Down
6 changes: 3 additions & 3 deletions invenio_records_resources/services/custom_fields/date.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from babel_edtf import parse_edtf
from edtf.parser.edtf_exceptions import EDTFParseException
from marshmallow import fields
from marshmallow_utils.fields import EDTFDateString, ISODateString
from marshmallow_utils.fields import EDTFDateTimeString, ISODateString
from pytz import utc

from .base import BaseListCF, ensure_no_field_cls
Expand All @@ -40,7 +40,7 @@ class EDTFDateStringCF(BaseListCF):
@ensure_no_field_cls
def __init__(self, name, **kwargs):
"""Constructor."""
super().__init__(name, field_cls=EDTFDateString, **kwargs)
super().__init__(name, field_cls=EDTFDateTimeString, **kwargs)

@property
def mapping(self):
Expand All @@ -50,7 +50,7 @@ def mapping(self):
@property
def field(self):
"""Marshmallow field custom fields."""
_schema = EDTFDateString(**self._field_args)
_schema = self._field_cls(**self._field_args)
if self._multiple:
return fields.List(_schema)
return _schema
Expand Down
Loading