Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
7787203e
Verified
Commit
7787203e
authored
11 months ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
DOC: Some rewording and typos.
parent
6e41fd1d
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!107
Release v0.11.0
,
!106
F gaps in int columns
Pipeline
#52563
passed
11 months ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CHANGELOG.md
+1
-1
1 addition, 1 deletion
CHANGELOG.md
src/caosadvancedtools/table_importer.py
+3
-3
3 additions, 3 deletions
src/caosadvancedtools/table_importer.py
unittests/test_table_importer.py
+1
-1
1 addition, 1 deletion
unittests/test_table_importer.py
with
5 additions
and
5 deletions
CHANGELOG.md
+
1
−
1
View file @
7787203e
...
...
@@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed ###
-
The
`TableImporter`
and its subclasses now change all integer datatypes to the
nullable
`pandas.Int64Datatype`
s
.th.
integer columns with empty fields can be
nullable
`pandas.Int64Datatype`
s
o that
integer columns with empty fields can be
treated properly. In case you don't want the datatypes to be changed
automatically, initialize the
`TableImporter`
with
`convert_int_to_nullable_int=False`
.
...
...
This diff is collapsed.
Click to expand it.
src/caosadvancedtools/table_importer.py
+
3
−
3
View file @
7787203e
...
...
@@ -244,8 +244,8 @@ class TableImporter():
Parameters
----------
converters : dict
Dict with column names as keys and converter functions as values. This dict
also defines
what columns
are required to exist throught the existing keys
. The converter functions are
Dict with column names as keys and converter functions as values. This dict
'
s keys also
define
what columns
must exist
. The converter functions are
applied to the cell values. They should also check for ValueErrors, such that a separate
value check is not necessary.
...
...
@@ -267,7 +267,7 @@ class TableImporter():
convert_int_to_nullable_int : bool, optional
Whether to convert all integer datatypes to ``pandas.Int64Dtype()``
which is nullable, to allow for integer columns with empty fields. If
set to False, a ``DataIn
C
onsistencyError`` will be raised in case of
set to False, a ``DataIn
c
onsistencyError`` will be raised in case of
empty fields in integer columns. Default is True.
"""
...
...
This diff is collapsed.
Click to expand it.
unittests/test_table_importer.py
+
1
−
1
View file @
7787203e
...
...
@@ -370,7 +370,7 @@ class CSVImporterTest(TableImporterTest):
df
=
importer_strict
.
read_file
(
tmpfile
.
name
)
assert
"
Integer column has NA values in column 1
"
in
str
(
die
.
value
)
# ... except when a nullable datatype is set
explicitly
# ... except when a nullable datatype is set
manually beforehand
kwargs
[
"
datatypes
"
][
"
int_with_gaps
"
]
=
"
Int64
"
importer_strict
=
CSVImporter
(
convert_int_to_nullable_int
=
False
,
**
kwargs
)
df
=
importer_strict
.
read_file
(
tmpfile
.
name
)
...
...
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