Skip to content

Commit

Permalink
Fix parser json (#2)
Browse files Browse the repository at this point in the history
* Revert 1 remove session (EMMC-ASBL#229)

* update strategies

* fix pre-commit

* create json parse strategy

* update parse strategies

* Updated dlite storage path

* Fixed duplication of data model names. Improved readability of the code

* Instanciate the Pydantic datamodel from a dict

* Added error handling#

* Set collection_id. Updated datamodel

* Updated parse strategy

* Update json strategy config

* Update json strategy config

* Added entity to config

* camel case storagePath

* rename storage path

* Refactor initialize method

* add quantity to generate

* Revert "add quantity to generate"

This reverts commit e000232.

* remove unused session parameter

* update otelib version

* update requirements.txt

* update oteapi-core

* fix pylint errors

* remove unnecessary session parameter

* fix otelib version

* fix tests

* fix test_generate

* fix syntax

* fix test_generate collection

* fix test_filter

* fix test_generate_collection

* update dataresource in test_convert

* fix test_convert, and pylint

* fix tests

* test_parse_json

* test_parse_json

* fix test_parse

* fix test_convert

* fix pylint errors

* replace resourceconfig with Parserconfig in parse strategies

* fix parse strategy

* -

* revert

* Allow for defining triplestore backend in the mapping strategy (EMMC-ASBL#225)

* Allow for defining triplestore backend in the mapping strategy

Co-authored-by: Thomas F. Hagelien <[email protected]>

* -

* remove unnecessary files

* fix test_parse_json

* -

* fix import error

* fix path issue

* fix  test_mapping

* -

* fix collection

* update  config in test_config

* fix test_parse_excel

* fix test_parse_excel

* -

* fix excel parser

* -

* fix test_image_config

* remove unnecessary startegies

* run pre-commit

* fix pylint issues

* fix pylint and docs

* remove unused strategies and add doc strings

* remove unused test entities and files

* -

* -

* -

* fix warning

* Revert "Remove session"

---------

Co-authored-by: Thomas F. Hagelien <[email protected]>
Co-authored-by: Thomas Hagelien <[email protected]>

* [Auto-generated] Update dependencies (EMMC-ASBL#228)

* Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 (EMMC-ASBL#224)

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.12 to 1.8.14.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.8.12...v1.8.14)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pytest requirement from ~=8.0 to ~=8.1 (EMMC-ASBL#227)

Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@8.0.0...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update mkdocstrings[python] requirement from ~=0.24.0 to ~=0.24.1 (EMMC-ASBL#226)

Updates the requirements on [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings) to permit the latest version.
- [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases)
- [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md)
- [Commits](mkdocstrings/mkdocstrings@0.24.0...0.24.1)

---
updated-dependencies:
- dependency-name: mkdocstrings[python]
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update `pre-commit` hooks

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Treesa Joseph <[email protected]>

* Revert 1 remove session (EMMC-ASBL#229)

* update strategies

* fix pre-commit

* create json parse strategy

* update parse strategies

* Updated dlite storage path

* Fixed duplication of data model names. Improved readability of the code

* Instanciate the Pydantic datamodel from a dict

* Added error handling#

* Set collection_id. Updated datamodel

* Updated parse strategy

* Update json strategy config

* Update json strategy config

* Added entity to config

* camel case storagePath

* rename storage path

* Refactor initialize method

* add quantity to generate

* Revert "add quantity to generate"

This reverts commit e000232.

* remove unused session parameter

* update otelib version

* update requirements.txt

* update oteapi-core

* fix pylint errors

* remove unnecessary session parameter

* fix otelib version

* fix tests

* fix test_generate

* fix syntax

* fix test_generate collection

* fix test_filter

* fix test_generate_collection

* update dataresource in test_convert

* fix test_convert, and pylint

* fix tests

* test_parse_json

* test_parse_json

* fix test_parse

* fix test_convert

* fix pylint errors

* replace resourceconfig with Parserconfig in parse strategies

* fix parse strategy

* -

* revert

* Allow for defining triplestore backend in the mapping strategy (EMMC-ASBL#225)

* Allow for defining triplestore backend in the mapping strategy

Co-authored-by: Thomas F. Hagelien <[email protected]>

* -

* remove unnecessary files

* fix test_parse_json

* -

* fix import error

* fix path issue

* fix  test_mapping

* -

* fix collection

* update  config in test_config

* fix test_parse_excel

* fix test_parse_excel

* -

* fix excel parser

* -

* fix test_image_config

* remove unnecessary startegies

* run pre-commit

* fix pylint issues

* fix pylint and docs

* remove unused strategies and add doc strings

* remove unused test entities and files

* -

* -

* -

* fix warning

* Revert "Remove session"

---------

Co-authored-by: Thomas F. Hagelien <[email protected]>
Co-authored-by: Thomas Hagelien <[email protected]>

* [Auto-generated] Update dependencies (EMMC-ASBL#228)

* Bump pypa/gh-action-pypi-publish from 1.8.12 to 1.8.14 (EMMC-ASBL#224)

Bumps [pypa/gh-action-pypi-publish](https://github.com/pypa/gh-action-pypi-publish) from 1.8.12 to 1.8.14.
- [Release notes](https://github.com/pypa/gh-action-pypi-publish/releases)
- [Commits](pypa/gh-action-pypi-publish@v1.8.12...v1.8.14)

---
updated-dependencies:
- dependency-name: pypa/gh-action-pypi-publish
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pytest requirement from ~=8.0 to ~=8.1 (EMMC-ASBL#227)

Updates the requirements on [pytest](https://github.com/pytest-dev/pytest) to permit the latest version.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](pytest-dev/pytest@8.0.0...8.1.1)

---
updated-dependencies:
- dependency-name: pytest
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update mkdocstrings[python] requirement from ~=0.24.0 to ~=0.24.1 (EMMC-ASBL#226)

Updates the requirements on [mkdocstrings[python]](https://github.com/mkdocstrings/mkdocstrings) to permit the latest version.
- [Release notes](https://github.com/mkdocstrings/mkdocstrings/releases)
- [Changelog](https://github.com/mkdocstrings/mkdocstrings/blob/main/CHANGELOG.md)
- [Commits](mkdocstrings/mkdocstrings@0.24.0...0.24.1)

---
updated-dependencies:
- dependency-name: mkdocstrings[python]
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update `pre-commit` hooks

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Treesa Joseph <[email protected]>

* update parse_json

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: Thomas F. Hagelien <[email protected]>
Co-authored-by: Thomas Hagelien <[email protected]>
Co-authored-by: TEAM 4.0[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
  • Loading branch information
5 people authored Mar 15, 2024
1 parent 2c71c00 commit c80c451
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cd_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:
run: python -m build

- name: Publish package to PyPI
uses: pypa/[email protected].12
uses: pypa/[email protected].14
with:
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ repos:
args: ["--line-length", "80"]

- repo: https://github.com/PyCQA/bandit
rev: 1.7.7
rev: 1.7.8
hooks:
- id: bandit
args: ["-r"]
files: ^oteapi_dlite/.*$

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.8.0
rev: v1.9.0
hooks:
- id: mypy
exclude: ^tests/.*$
Expand Down
10 changes: 5 additions & 5 deletions oteapi_dlite/strategies/parse_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,16 @@ class DLiteJsonParseConfig(AttrDict):
),
] = "json-data"

resourceType: Literal["resource/url"] = Field(
resourceType: Optional[Literal["resource/url"]] = Field(
"resource/url",
description=ResourceConfig.model_fields["resourceType"].description,
)
downloadUrl: HostlessAnyUrl = Field(
...,
downloadUrl: Optional[HostlessAnyUrl] = Field(
None,
description=ResourceConfig.model_fields["downloadUrl"].description,
)
mediaType: str = Field(
...,
mediaType: Optional[str] = Field(
None,
description=ResourceConfig.model_fields["mediaType"].description,
)
storage_path: Annotated[
Expand Down
2 changes: 1 addition & 1 deletion requirements_dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
otelib==v0.5.0.dev0
pylint~=3.1
pytest~=8.0
pytest~=8.1
pytest-cov~=4.1
pyyaml>=5.0
2 changes: 1 addition & 1 deletion requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ mike~=2.0
mkdocs~=1.5
mkdocs-awesome-pages-plugin~=2.9
mkdocs-material~=9.5
mkdocstrings[python]~=0.24.0
mkdocstrings[python]~=0.24.1
pre-commit~=3.6

0 comments on commit c80c451

Please sign in to comment.