Skip to content

Commit

Permalink
stringified all values
Browse files Browse the repository at this point in the history
  • Loading branch information
jlloyd-widen committed Feb 26, 2024
1 parent ae3df95 commit 63aa0a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
8 changes: 8 additions & 0 deletions tap_orca/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,11 @@ def get_new_paginator(self) -> BaseAPIPaginator:
A paginator instance.
"""
return BaseOffsetPaginator(0, self.page_size)

def post_process(
self,
row: dict,
context: dict | None = None, # noqa: ARG002
) -> dict | None:
"""Post-process a record before writing it."""
return {k: str(v) for k, v in row.items()}
18 changes: 12 additions & 6 deletions tap_orca/tap.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,13 @@ class TapOrca(Tap):
th.ArrayType(th.StringType),
required=False,
description="The primary keys for the custom stream."
)
),
th.Property(
"schema",
th.ArrayType(th.StringType),
required=False,
description="A simple schema for the custom stream."
),
)

config_jsonschema = th.PropertiesList(
Expand Down Expand Up @@ -101,17 +107,17 @@ def discover_schema(self, query: str) -> dict:
th.CustomType(jsonschema_type_dict={
"anyOf": [
{"type": "null"},
{"type": "object"},
{"type": "array"},
# {"type": "object"},
# {"type": "array"},
{"type": "string"},
{"type": "number"},
# {"type": "number"},
# {"type": "boolean"}, # causes all values to be a boolean
{"type": "integer"},
# {"type": "integer"},
]
})
),
)

self.logger.info("Schema discovery complete.")
return schema.to_dict()


Expand Down

0 comments on commit 63aa0a0

Please sign in to comment.