fix: 数値のカンマ除去処理を修正
軽微な修正も一緒に
This commit is contained in:
parent
7909ad7034
commit
9280a7cdab
@ -1,12 +1,14 @@
|
||||
from datetime import datetime
|
||||
import csv
|
||||
import io
|
||||
import re
|
||||
from datetime import datetime
|
||||
|
||||
import boto3
|
||||
import pymysql
|
||||
from pymysql.constants import CLIENT
|
||||
import io
|
||||
import csv
|
||||
|
||||
from common import convert_quotechar, debug_log
|
||||
from error import error
|
||||
from common import debug_log, convert_quotechar
|
||||
|
||||
# 定数
|
||||
DIRECTORY_WORK = '/work/'
|
||||
@ -150,7 +152,7 @@ def main(bucket_name, target_data_source, target_file_name, settings_key, db_inf
|
||||
sql = f'{sql} NULL,'
|
||||
continue
|
||||
|
||||
# データ項目値の変換処理
|
||||
# データ項目値の変換処理(カンマ除去)
|
||||
org_column_value = line[i]
|
||||
current_settings_db_column_name = settings_db_columu_list[i]
|
||||
column_value = convert_column_value(org_column_value, current_settings_db_column_name, settings_replace_comma_list)
|
||||
@ -312,7 +314,7 @@ def connection_close(conn, bucket_name, target_data_source, target_file_name, lo
|
||||
|
||||
def convert_column_value(org_column_value, current_settings_db_column_name, settings_replace_comma_list):
|
||||
"""データ項目値変換処理
|
||||
|
||||
- 数値内のカンマ除去処理
|
||||
Args:
|
||||
org_column_value : 投入データの値
|
||||
current_settings_db_column_name : 投入データのDBカラム物理名
|
||||
@ -321,13 +323,14 @@ def convert_column_value(org_column_value, current_settings_db_column_name, sett
|
||||
Returns:
|
||||
converted_column_value:変換処理を行った投入データの値
|
||||
"""
|
||||
# 投入データのDB物理カラム名が設定ファイルの数値型のDBカラム物理名に含まれている場合、データ項目値の「,」を取り除く
|
||||
# 投入データのDB物理カラム名が設定ファイルの数値型のDBカラム物理名に含まれている場合、データ項目値の「,」を取り除く
|
||||
converted_column_value = org_column_value
|
||||
if current_settings_db_column_name in settings_replace_comma_list:
|
||||
converted_column_value = converted_column_value.replace(',', '')
|
||||
|
||||
return converted_column_value
|
||||
|
||||
|
||||
|
||||
def truncate_judge(settings_list):
|
||||
"""TRUNCATE処理対応判定
|
||||
Args:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user