Skip to content
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

Merged
merged 1 commit into from
Jul 22, 2024
Merged

Conversation

nissy0409240
Copy link
Collaborator

Brief

Convert the type of a specific column in a csv file.

Points to Check

  • Is there any discomfort in the corresponding parts and contents?

Test

Confirmed

Review Limit

  • As soon as possible.

@nissy0409240 nissy0409240 self-assigned this Jul 16, 2024
@nissy0409240 nissy0409240 linked an issue Jul 16, 2024 that may be closed by this pull request
@nissy0409240 nissy0409240 force-pushed the 454 branch 3 times, most recently from 3c61cff to 88e8bf9 Compare July 16, 2024 19:00
@@ -40,6 +40,7 @@ python-gnupg = "==0.4.8"
openpyxl = "==3.0.9"
pyminizip = "==0.2.5"
psycopg2 = "==2.9.1"
numpy = "<2"
Copy link
Collaborator Author

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.

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

型変換が失敗した場合の挙動を定義してください。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご確認ありがとうございます
定義しました

@@ -285,6 +285,68 @@ def _read_csv_func(self, chunksize, fi, fo):
first_write = False


class CsvColumnTypeConvert(FileBaseTransform):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

カラムを加工するわけではないので、classの名前はCsvTypeConvertでいかがでしょうか。

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ご確認ありがとうございます
対応しました

@yasuhiro-ohba yasuhiro-ohba merged commit 0d94f86 into master Jul 22, 2024
5 checks passed
@nissy0409240 nissy0409240 deleted the 454 branch July 22, 2024 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert the type of a specific column in a csv file.
2 participants