From 74fa70a9b7b2051d296a57ac83b5fe570dd45e14 Mon Sep 17 00:00:00 2001 From: Josh lloyd Date: Fri, 21 Jun 2024 12:25:38 -0600 Subject: [PATCH] removed the code field from customer_recipes --- meltano.yml | 4 ++-- pyproject.toml | 2 +- tap_workato/streams.py | 49 ++++++++++++++++-------------------------- 3 files changed, 21 insertions(+), 34 deletions(-) diff --git a/meltano.yml b/meltano.yml index 9ad5517..5f609f5 100644 --- a/meltano.yml +++ b/meltano.yml @@ -16,8 +16,8 @@ plugins: kind: password - name: user_email kind: password -# select: -# - 'customer_recipes.*' + select: + - 'customer_recipes.*' # - '!api_clients.*' loaders: - name: target-jsonl diff --git a/pyproject.toml b/pyproject.toml index 3d52825..fe77550 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [ diff --git a/tap_workato/streams.py b/tap_workato/streams.py index cc90f4b..0115db2 100644 --- a/tap_workato/streams.py +++ b/tap_workato/streams.py @@ -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 @@ -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( @@ -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 {