Skip to content

Commit

Permalink
Merge pull request #23 from Bugazelle/dev
Browse files Browse the repository at this point in the history
[Feat] --tag_columns not mandatory
  • Loading branch information
Bugazelle authored Feb 14, 2020
2 parents 3ad55b7 + 4c31e36 commit e48cfc9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ You could use `export_csv_to_influx -h` to see the help guide.
-tf, --time_format, Timestamp format. Default: '%Y-%m-%d %H:%M:%S' e.g.: 1970-01-01 00:00:00.
-tz, --time_zone, Timezone of supplied data. Default: UTC.
-fc, --field_columns, List of csv columns to use as fields, separated by comma. **Mandatory**
-tc, --tag_columns, List of csv columns to use as tags, separated by comma. **Mandatory**
-tc, --tag_columns, List of csv columns to use as tags, separated by comma. Default: None
-b, --batch_size, Batch size when inserting data to influx. Default: 500.
-lslc, --limit_string_length_columns, Limit string length column, separated by comma. Default: None.
-ls, --limit_length, Limit length. Default: 20.
Expand Down
2 changes: 1 addition & 1 deletion src/ExportCsvToInflux/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.1.20'
__version__ = '0.1.21'
12 changes: 6 additions & 6 deletions src/ExportCsvToInflux/exporter_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ def export_csv_to_influx(self,
csv_file,
db_name,
db_measurement,
tag_columns,
field_columns,
tag_columns=None,
db_server_name='localhost:8086',
db_user='admin',
db_password='admin',
Expand Down Expand Up @@ -266,9 +266,9 @@ def export_csv_to_influx(self,
'Please check the fields are in csv headers or not. Exporter stopping...')
continue
if not tag_columns:
print('Error: The input --tag_columns does not expected. '
'Please check the fields are in csv headers or not. Exporter stopping...')
continue
print('Warning: The input --tag_columns does not expected or leaves None. '
'Please check the fields are in csv headers or not. Continue checking...')
# continue
match_columns = self.__validate_columns(csv_headers, match_columns)
filter_columns = self.__validate_columns(csv_headers, filter_columns)

Expand Down Expand Up @@ -496,8 +496,8 @@ def export_csv_to_influx():
help='Timezone of supplied data. Default: UTC')
parser.add_argument('-fc', '--field_columns', required=True,
help='List of csv columns to use as fields, separated by comma')
parser.add_argument('-tc', '--tag_columns', required=True,
help='List of csv columns to use as tags, separated by comma')
parser.add_argument('-tc', '--tag_columns', nargs='?', default=None, const=None,
help='List of csv columns to use as tags, separated by comma. Default: None')
parser.add_argument('-b', '--batch_size', nargs='?', default=500, const=500,
help='Batch size when inserting data to influx. Default: 500.')
parser.add_argument('-lslc', '--limit_string_length_columns', nargs='?', default=None, const=None,
Expand Down
2 changes: 1 addition & 1 deletion 中文说明.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pip install ExportCsvToInflux
-tf, --time_format, 时间戳格式. 默认: '%Y-%m-%d %H:%M:%S' 比如: 1970-01-01 00:00:00.
-tz, --time_zone, 时区. 默认: UTC
-fc, --field_columns, field列, 如果多列, 使用英文逗号 ',' 作为分隔符. **强制**
-tc, --tag_columns, tag列, 如果多列, 使用英文逗号 ',' 作为分隔符. **强制**
-tc, --tag_columns, tag列, 如果多列, 使用英文逗号 ',' 作为分隔符, 默认: None
-b, --batch_size, 批量插入数据库大小. 默认: 500
-lslc, --limit_string_length_columns, 设置某列或多列中数据的长度, 如果多列, 使用英文逗号 ',' 作为分隔符. 默认: None
-ls, --limit_length, 长度大小. 默认: 20
Expand Down

0 comments on commit e48cfc9

Please sign in to comment.