Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
35
Issue boards
Milestones
Wiki
Code
Merge requests
7
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rdm-software
SaQC
Commits
26afce20
Commit
26afce20
authored
3 years ago
by
Peter Lünenschloß
Browse files
Options
Downloads
Patches
Plain Diff
unused KW-warning removed
parent
23e6f6b3
No related branches found
Branches containing commit
No related tags found
2 merge requests
!370
Release 2.0
,
!341
unused KW-warning removed
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/core/core.py
+0
-40
0 additions, 40 deletions
saqc/core/core.py
with
0 additions
and
40 deletions
saqc/core/core.py
+
0
−
40
View file @
26afce20
...
...
@@ -266,11 +266,6 @@ class SaQC(FunctionsMixin):
assert
data
.
columns
.
difference
(
flags
.
columns
).
empty
data
,
flags
=
function
(
data
=
data
,
flags
=
flags
,
field
=
field
,
*
args
,
**
kwargs
)
# we check the passed function-kwargs after the actual call,
# because now "hard" errors would already have been raised
# (eg. `TypeError: got multiple values for argument 'data'`,
# when the user pass data=...)
_warnForUnusedKwargs
(
function
,
kwargs
,
self
.
_translator
)
planned
=
self
.
called
+
[(
field
,
(
function
,
args
,
kwargs
))]
...
...
@@ -305,38 +300,3 @@ class SaQC(FunctionsMixin):
def
__deepcopy__
(
self
,
memodict
=
None
):
return
self
.
copy
(
deep
=
True
)
def
_warnForUnusedKwargs
(
func
,
keywords
,
translator
:
Translator
):
"""
Warn for unused kwargs, passed to a SaQC.function.
Parameters
----------
func: SaqcFunction
Saqc internal data structure that hold all function info.
Returns
-------
None
Notes
-----
A single warning is thrown, if any number of missing kws are detected,
naming each missing kw.
"""
sig_kws
=
inspect
.
signature
(
func
).
parameters
# we need to ignore kws that are injected or by default hidden in ``**kwargs``
ignore
=
(
"
to_mask
"
,)
missing
=
[]
for
kw
in
keywords
:
# there is no need to check for
# `kw in [KEYWORD_ONLY, VAR_KEYWORD or POSITIONAL_OR_KEYWORD]`
# because this would have raised an error beforehand.
if
kw
not
in
sig_kws
and
kw
not
in
ignore
and
kw
not
in
translator
.
ARGUMENTS
:
missing
.
append
(
kw
)
if
missing
:
missing
=
"
,
"
.
join
(
missing
)
warnings
.
warn
(
f
"
Unused argument(s):
{
missing
}
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment