Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SaQC
Manage
Activity
Members
Labels
Plan
Issues
36
Issue boards
Milestones
Wiki
Code
Merge requests
8
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
105dfcb1
Commit
105dfcb1
authored
3 years ago
by
Bert Palm
🎇
Browse files
Options
Downloads
Patches
Plain Diff
make _swapToTarget more strict
parent
ac7a697e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!370
Release 2.0
Pipeline
#51902
failed with stage
Stage: test
in 1 minute and 39 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
saqc/lib/tools.py
+8
-6
8 additions, 6 deletions
saqc/lib/tools.py
with
8 additions
and
6 deletions
saqc/lib/tools.py
+
8
−
6
View file @
105dfcb1
...
...
@@ -26,12 +26,14 @@ T = TypeVar("T", str, float, int)
def
_swapToTarget
(
field
,
target
,
flags
):
if
target
:
if
target
in
flags
.
columns
:
raise
ValueError
(
"
Target already exists.
"
)
flags
.
history
[
target
]
=
flags
.
history
[
field
].
copy
()
return
target
or
field
,
flags
if
target
is
None
:
return
field
,
flags
if
not
isinstance
(
target
,
str
):
raise
TypeError
(
f
'
target must be of type string, not
{
repr
(
type
(
target
))
}
'
)
if
target
in
flags
.
columns
:
raise
ValueError
(
f
"
cannot create target
{
repr
(
target
)
}
, it already exists.
"
)
flags
.
history
[
target
]
=
flags
.
history
[
field
].
copy
()
return
target
,
flags
def
assertScalar
(
name
,
value
,
optional
=
False
):
...
...
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