Alejandro A
09/22/2024, 6:10 PMstream_maps:
date_column: date_column if not str(date_column).startswith('0000-0') else None
Reuben (Matatika)
09/23/2024, 12:49 PMstream_maps:
stream_name:
__filter__: not self.startswith('0000-0')
https://sdk.meltano.com/en/latest/stream_maps.html#filtering-out-records-from-a-stream-using-filter-operationReuben (Matatika)
09/23/2024, 12:55 PMT
)...
>>> datetime.fromisoformat("2024-01-01 00:00:00")
datetime.datetime(2024, 1, 1, 0, 0)
What's the error from the target? Maybe it's expecting the T
?
stream_maps:
stream_name:
date_column: self.replace(" ", "T")
https://stackoverflow.com/a/9532375Alejandro A
09/23/2024, 1:36 PMReuben (Matatika)
09/23/2024, 1:49 PMReuben (Matatika)
09/23/2024, 1:50 PMmeltano invoke tap > tap.out
cat tap.out | meltano invoke target-bigquery # logs from this
Alejandro A
09/23/2024, 2:16 PMerror[]
which then is emptyAlejandro A
09/23/2024, 2:17 PM0001-01-01 00
according to this https://popsql.com/learn-sql/bigquery/date-and-time-data-types-in-bigquery so 0000-00-00 would be outside thoseReuben (Matatika)
09/23/2024, 2:23 PM0000-00-00
as some placeholder value. That should be a fairly easy transform then:
stream_maps:
stream_name:
date_column: self if not self.startswith("0000") else datetime.datetime.min.isoformat()
Alejandro A
09/23/2024, 2:35 PMReuben (Matatika)
09/23/2024, 2:56 PMAlejandro A
10/03/2024, 1:12 PM___filter___: 1 != 1
. But all the data is still being extracted (I am using this filter to debug, original cause did not work) for the stream, any idea?Alejandro A
10/03/2024, 1:43 PMrecord['foo'] != 0
and other accesing the property directly like foo != 0
Alejandro A
10/03/2024, 1:43 PMAlejandro A
10/03/2024, 1:46 PM- name: foo-tap
config:
stream_maps:
non_existing_stream:
__filter__: non_existing_field != bar
Alejandro A
10/03/2024, 1:47 PMAlejandro A
10/03/2024, 1:49 PM- name: foo-tap
config:
stream_maps:
non_existing_stream:
foo: bar
__filter__: non_existing_field != bar
But they are not in the jsonl target, so yeahAlejandro A
10/03/2024, 1:53 PMReuben (Matatika)
10/03/2024, 1:55 PMstream_maps
is only natively supported by taps/targets built with the Meltano SDK. For others, you can use the meltano-map-transformer mapper plugin.Alejandro A
10/03/2024, 1:55 PMReuben (Matatika)
10/03/2024, 1:57 PMReuben (Matatika)
10/03/2024, 1:58 PMNote: to support non-SDK taps and targets, the standalone inline mapper plugin meltano-map-transformer follows all specifications defined here and can apply mapping transformations between any Singer tap and target, even if they are not built using the SDK.
Reuben (Matatika)
10/03/2024, 1:59 PM