| 71 | self.filetype = "CSV" |
| 72 | |
| 73 | def to_dict(self) -> Dict: |
| 74 | options = {} |
| 75 | options["delimiter"] = self.delimiter |
| 76 | options["header_row"] = self.header_row |
| 77 | if self.include_columns: |
| 78 | options["schema"] = ",".join(self.include_columns) |
| 79 | if self.column_types: |
| 80 | cpp_types = [utils.data_type_to_cpp(dt) for dt in self.column_types] |
| 81 | options["column_types"] = ",".join(cpp_types) |
| 82 | if self.force_include_all: |
| 83 | options["include_all_columns"] = self.force_include_all |
| 84 | options["filetype"] = self.filetype |
| 85 | return options |
| 86 | |
| 87 | def __str__(self) -> str: |
| 88 | return "&".join(["{}={}".format(k, v) for k, v in self.to_dict().items()]) |