Skip to content

Commit

Permalink
removed the code field from customer_recipes
Browse files Browse the repository at this point in the history
  • Loading branch information
jlloyd-widen committed Jun 21, 2024
1 parent 7b4fc16 commit 74fa70a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 34 deletions.
4 changes: 2 additions & 2 deletions meltano.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ plugins:
kind: password
- name: user_email
kind: password
# select:
# - 'customer_recipes.*'
select:
- 'customer_recipes.*'
# - '!api_clients.*'
loaders:
- name: target-jsonl
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tap-workato"
version = "0.1.0"
version = "0.1.1"
description = "`tap-workato` is a Singer tap for Workato, built with the Meltano SDK for Singer Taps."
authors = ["Josh Lloyd"]
keywords = [
Expand Down
49 changes: 18 additions & 31 deletions tap_workato/streams.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Stream type classes for tap-workato."""
import json
import sys
from typing import Optional

from singer_sdk import typing as th
Expand Down Expand Up @@ -377,22 +378,23 @@ class CustomerRecipesStream(CustomerChildStreams):
th.Property("version_no", th.IntegerType),
th.Property("webhook_url", th.StringType),
th.Property("stop_cause", th.StringType),
th.Property("code_number", th.IntegerType),
th.Property("code_provider", th.StringType),
th.Property("code_name", th.StringType),
th.Property("code_as", th.StringType),
th.Property("code_title", th.StringType),
th.Property("code_description", th.StringType),
th.Property("code_keyword", th.StringType),
th.Property("code_dynamicPickListSelection", th.StringType),
th.Property("code_toggleCfg", th.StringType),
th.Property("code_input", th.StringType),
th.Property("code_extended_output_schema", th.StringType),
th.Property("code_extended_input_schema", th.StringType),
th.Property("code_visible_config_fields", th.StringType),
th.Property("code_block", th.StringType),
th.Property("code_uuid", th.StringType),
th.Property("code_unfinished", th.BooleanType),
# th.Property("code", th.StringType),
# th.Property("code_number", th.IntegerType),
# th.Property("code_provider", th.StringType),
# th.Property("code_name", th.StringType),
# th.Property("code_as", th.StringType),
# th.Property("code_title", th.StringType),
# th.Property("code_description", th.StringType),
# th.Property("code_keyword", th.StringType),
# th.Property("code_dynamicPickListSelection", th.StringType),
# th.Property("code_toggleCfg", th.StringType),
# th.Property("code_input", th.StringType),
# th.Property("code_extended_output_schema", th.StringType),
# th.Property("code_extended_input_schema", th.StringType),
# th.Property("code_visible_config_fields", th.StringType),
# th.Property("code_block", th.StringType),
# th.Property("code_uuid", th.StringType),
# th.Property("code_unfinished", th.BooleanType),
th.Property(
"config",
th.ArrayType(
Expand All @@ -407,21 +409,6 @@ class CustomerRecipesStream(CustomerChildStreams):
),
).to_dict()

def post_process(self, row: dict, context: Optional[dict] = None) -> Optional[dict]:
"""As needed, append or transform raw data to match expected structure."""
new_row = row.copy()

# flatten the code object because it can get to large for target systems
code = json.loads(row["code"])
del new_row["code"]
for key, value in code.items():
if isinstance(value, dict) or isinstance(value, list):
new_row[f"code_{key}"] = json.dumps(value)
else:
new_row[f"code_{key}"] = value

return new_row

# def get_child_context(self, record: dict, context: Optional[dict]) -> dict:
# """Return a context dictionary for child streams."""
# return {
Expand Down

0 comments on commit 74fa70a

Please sign in to comment.