-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert the type of a specific column in a csv file. #455
Conversation
3c61cff
to
88e8bf9
Compare
@@ -40,6 +40,7 @@ python-gnupg = "==0.4.8" | |||
openpyxl = "==3.0.9" | |||
pyminizip = "==0.2.5" | |||
psycopg2 = "==2.9.1" | |||
numpy = "<2" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed several tests that would fail if the numpy version was not fixed.
cliboa/scenario/transform/csv.py
Outdated
if self._type == "int": | ||
# When reading from csv, the following error occurs: | ||
# ValueError: invalid literal for int() with base 10 | ||
# To avoid this, convert to float and then convert to int |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
型変換が失敗した場合の挙動を定義してください。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご確認ありがとうございます
定義しました
cliboa/scenario/transform/csv.py
Outdated
@@ -285,6 +285,68 @@ def _read_csv_func(self, chunksize, fi, fo): | |||
first_write = False | |||
|
|||
|
|||
class CsvColumnTypeConvert(FileBaseTransform): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
カラムを加工するわけではないので、classの名前はCsvTypeConvertでいかがでしょうか。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ご確認ありがとうございます
対応しました
Brief
Convert the type of a specific column in a csv file.
Points to Check
Test
Confirmed
Review Limit
As soon as possible.