Skip to content

Commit

Permalink
fix(batch-exports): Cast str config values (#27571)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomasfarias authored Jan 16, 2025
1 parent a2eda38 commit 44f4898
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions posthog/batch_exports/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ class S3BatchExportInputs:
batch_export_model: BatchExportModel | None = None
batch_export_schema: BatchExportSchema | None = None

def __post_init__(self):
if self.max_file_size_mb:
self.max_file_size_mb = int(self.max_file_size_mb)


@dataclass
class SnowflakeBatchExportInputs:
Expand Down Expand Up @@ -154,6 +158,14 @@ class PostgresBatchExportInputs:
batch_export_model: BatchExportModel | None = None
batch_export_schema: BatchExportSchema | None = None

def __post_init__(self):
if self.has_self_signed_cert == "True": # type: ignore
self.has_self_signed_cert = True
elif self.has_self_signed_cert == "False": # type: ignore
self.has_self_signed_cert = False

self.port = int(self.port)


@dataclass
class RedshiftBatchExportInputs(PostgresBatchExportInputs):
Expand Down Expand Up @@ -186,6 +198,12 @@ class BigQueryBatchExportInputs:
batch_export_model: BatchExportModel | None = None
batch_export_schema: BatchExportSchema | None = None

def __post_init__(self):
if self.use_json_type == "True": # type: ignore
self.use_json_type = True
elif self.use_json_type == "False": # type: ignore
self.use_json_type = False


@dataclass
class HttpBatchExportInputs:
Expand Down

0 comments on commit 44f4898

Please sign in to comment.