This repository was archived by the owner on Apr 16, 2026. It is now read-only.
Proposed fix for issue #718#168
Merged
Merged
Conversation
The `dataclasses` package uses the built-in class signature detection to throw a TypeError if an unrecognized parameter is passed in a constructor. This: a) makes it difficult or impossible to print information about where the parameter came from in a yaml (other file) b) limits our options as to whether we go ahead and continue processing. The current fix (prior to this submission) was overriding the `_init_fn` in the dataclasses library, which turned out to be anything but stable. This new fix, instead, tries to focus on the `_create_fn`, whose signature and behavior is considerably more stable. IF this fix works, we want to proceed by changing the python generators to emit something like: ```python import linkml_runtime.utils.dataclass_extensions_376 as dc_tweak # This line makes certain that the import remains DC_IN = dc_tweak.DC_CREATE_FN ``` And, finally, renaming `dataclass_extensions_376` to something more reasonable.
Member
Reduce the chance of unintended namespace collisions
Codecov Report
@@ Coverage Diff @@
## main #168 +/- ##
==========================================
+ Coverage 62.54% 63.95% +1.41%
==========================================
Files 49 49
Lines 5219 5105 -114
Branches 1468 1394 -74
==========================================
+ Hits 3264 3265 +1
+ Misses 1593 1480 -113
+ Partials 362 360 -2
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
dataclassespackage uses the built-in class signature detection to throw aTypeError if an unrecognized parameter is passed in a constructor. This:
a) makes it difficult or impossible to print information about where the parameter came from in a yaml (other file)
b) limits our options as to whether we go ahead and continue processing.
The current fix (prior to this submission) was overriding the
_init_fnin thedataclasses library, which turned out to be anything but stable. This new fix,
instead, tries to focus on the
_create_fn, whose signature and behavior isconsiderably more stable.
IF this fix works, we want to proceed by changing the python generators to emit something like:
And, finally, renaming
dataclass_extensions_376to something more reasonable.