I copied get_batches from singer_sdk/streams/core.py into the mssqlStream class. To stop pylance from barking about the new union style not allowed I copied and added from __future__ import annotations from core.py to the client.py file.
I followed this article https://dev.to/kfuquay/extending-pythons-json-encoder-7k0that which has a nice write up on how to extended the JSONEncoder class. The only change needed was to use the pendulum line from the sdk _typing.py to format the datetime string
obj = pendulum.instance(obj).isoformat()
Here is the line with the extended encoder in place
(json.dumps(record, cls=CustomJSONEncoder) + "\n").encode() for record in chunk
Fixes #2
I copied
get_batches
fromsinger_sdk/streams/core.py
into themssqlStream
class. To stop pylance from barking about the new union style not allowed I copied and addedfrom __future__ import annotations
fromcore.py
to theclient.py
file. I followed this article https://dev.to/kfuquay/extending-pythons-json-encoder-7k0that which has a nice write up on how to extended the JSONEncoder class. The only change needed was to use the pendulum line from the sdk_typing.py
to format the datetime stringobj = pendulum.instance(obj).isoformat()
Here is the line with the extended encoder in place
(json.dumps(record, cls=CustomJSONEncoder) + "\n").encode() for record in chunk