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
b8ad7914
Commit
b8ad7914
authored
3 years ago
by
David Schäfer
Browse files
Options
Downloads
Patches
Plain Diff
[FIX] flagGeneric: don't fail on empty data
parent
a2acd418
No related branches found
Branches containing commit
No related tags found
Tags containing commit
7 merge requests
!685
Release 2.4
,
!684
Release 2.4
,
!567
Release 2.2.1
,
!566
Release 2.2
,
!501
Release 2.1
,
!400
Relase 2.0.1
,
!389
[FIX] flagGeneric: don't fail on empty data
Pipeline
#55212
passed with stage
in 1 minute and 40 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
saqc/funcs/generic.py
+1
-1
1 addition, 1 deletion
saqc/funcs/generic.py
tests/funcs/test_generic_api_functions.py
+14
-0
14 additions, 0 deletions
tests/funcs/test_generic_api_functions.py
with
15 additions
and
1 deletion
saqc/funcs/generic.py
+
1
−
1
View file @
b8ad7914
...
...
@@ -267,7 +267,7 @@ def flagGeneric(
f
"
the generic function returned
{
len
(
result
.
columns
)
}
field(s), but only
{
len
(
targets
)
}
target(s) were given
"
)
if
not
(
result
.
dtypes
==
bool
).
all
():
if
not
result
.
empty
and
not
(
result
.
dtypes
==
bool
).
all
():
raise
TypeError
(
f
"
generic expression does not return a boolean array
"
)
meta
=
{
...
...
This diff is collapsed.
Click to expand it.
tests/funcs/test_generic_api_functions.py
+
14
−
0
View file @
b8ad7914
...
...
@@ -8,6 +8,7 @@ from dios.dios.dios import DictOfSeries
from
saqc.constants
import
BAD
,
UNFLAGGED
,
FILTER_ALL
from
saqc.core.flags
import
Flags
from
saqc
import
SaQC
from
saqc.core.register
import
_isflagged
from
saqc.lib.tools
import
toSequence
from
tests.common
import
initData
...
...
@@ -18,6 +19,19 @@ def data():
return
initData
()
def
test_emptyData
():
# test that things do not break with empty data sets
saqc
=
SaQC
(
data
=
pd
.
DataFrame
({
"
x
"
:
[],
"
y
"
:
[]}))
saqc
.
flagGeneric
(
"
x
"
,
func
=
lambda
x
:
x
<
0
)
assert
saqc
.
data
.
empty
assert
saqc
.
flags
.
empty
saqc
=
saqc
.
processGeneric
(
field
=
"
x
"
,
target
=
"
y
"
,
func
=
lambda
x
:
x
+
2
)
assert
saqc
.
data
.
empty
assert
saqc
.
flags
.
empty
def
test_writeTargetFlagGeneric
(
data
):
params
=
[
([
"
tmp
"
],
lambda
x
,
y
:
pd
.
Series
(
True
,
index
=
x
.
index
.
union
(
y
.
index
))),
...
...
This diff is collapsed.
Click to expand it.
David Schäfer
@schaefed
mentioned in commit
63b55c6d
·
2 years ago
mentioned in commit
63b55c6d
mentioned in commit 63b55c6d7dadb0e612b23a897f292d5ffc14cb52
Toggle commit list
David Schäfer
@schaefed
mentioned in commit
684dc8a0
·
2 years ago
mentioned in commit
684dc8a0
mentioned in commit 684dc8a0515470d644fc85fee95d07661c8dd572
Toggle commit list
David Schäfer
@schaefed
mentioned in commit
8f7a90e4
·
1 year ago
mentioned in commit
8f7a90e4
mentioned in commit 8f7a90e4aed61c79a9dc8d67541a46beba0907e8
Toggle commit list
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