Skip to content

Commit

Permalink
✨ Issue #89 #90 possible breaking for FHIRAbstractModel.dict (if …
Browse files Browse the repository at this point in the history
…pydnatic specific extra argument has been provided) is neutralized.
  • Loading branch information
nazrulworld committed Jan 14, 2022
1 parent 5cd42e1 commit a161c88
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 7 deletions.
2 changes: 1 addition & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ History
6.2.1 (unreleased)
------------------

- Nothing changed yet.
- Issues `#89 <https://github.com/nazrulworld/fhir.resources/issues/89>`_ & `#90 <https://github.com/nazrulworld/fhir.resources/issues/90>`_ possible breaking for ``FHIRAbstractModel.dict`` (if pydnatic specific extra argument has been provided) is neutralized.[nazrulworld]


6.2.0 (2022-01-01)
Expand Down
6 changes: 0 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,6 @@ install:
- ECHO "Installed SDKs:"
- ps: "ls \"C:/Program Files/Microsoft SDKs/Windows\""

# Install Rust dependency
- appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
- rustup-init -yv --default-toolchain stable --default-host x86_64-pc-windows-msvc
- set PATH=%PATH%;%USERPROFILE%\.cargo\bin
- rustc -vV
- cargo -vV
# Prepend newly installed Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
Expand Down
13 changes: 13 additions & 0 deletions fhir/resources/STU3/fhirabstractmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,20 @@ def dict(
by_alias: bool = True,
exclude_none: bool = True,
exclude_comments: bool = False,
**pydantic_extra
) -> OrderedDict:
"""important!
there is no impact on ``pydantic_extra`` we keep it as backward compatibility.
@see issues https://github.com/nazrulworld/fhir.resources/issues/90
& https://github.com/nazrulworld/fhir.resources/issues/89
"""
if len(pydantic_extra) > 0:
logger.warning(
f"{self.__class__.__name__}.dict method accepts only"
"´by_alias´, ´exclude_none´, ´exclude_comments` as parameters"
" since version v6.2.0, any extra parameter is simply ignored. "
"You should not provide any extra argument."
)
return OrderedDict(
self._fhir_iter(
by_alias=by_alias,
Expand Down
13 changes: 13 additions & 0 deletions fhir/resources/fhirabstractmodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,20 @@ def dict(
by_alias: bool = True,
exclude_none: bool = True,
exclude_comments: bool = False,
**pydantic_extra
) -> OrderedDict:
"""important!
there is no impact on ``pydantic_extra`` we keep it as backward compatibility.
@see issues https://github.com/nazrulworld/fhir.resources/issues/90
& https://github.com/nazrulworld/fhir.resources/issues/89
"""
if len(pydantic_extra) > 0:
logger.warning(
f"{self.__class__.__name__}.dict method accepts only"
"´by_alias´, ´exclude_none´, ´exclude_comments` as parameters"
" since version v6.2.0, any extra parameter is simply ignored. "
"You should not provide any extra argument."
)
return OrderedDict(
self._fhir_iter(
by_alias=by_alias,
Expand Down

0 comments on commit a161c88

Please sign in to comment.