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

fix(batch-exports): Cast str config values #27571

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading