Hello, regarding target-hubspot, i've encountered ...
# singer-target-development
l
Hello, regarding target-hubspot, i've encountered a TODO comment in the source code that is relevant for my usage: https://github.com/MeltanoLabs/target-hubspot/blob/f4ecfab7348cff7333ef1748a725164cc9672491/target_hubspot/target.py#L46 i need to insert data to a custom hubspot object, and i have forked the repo in order to implement a version that suits my requirements. i'd also like to push a pull request to handle it, and i'm wondering which solution is better: 1. remove the validation altogether - if hubspot supports large amount of custom values there shouldn't be a validation like singer-sdk provides (which only allows specific values, no wild-cards) 2. add to the array all possible values of "2-X" to "2-XXXXXXXX" - this will definietly work and maintain the validation - the biggest downside i can see is that on errors the logs will be flooded with that huge array. so something like:
allowed_values=["0-1", "0-2", "0-3", "0-5", "0-48", "0-49", "0-47", "0-4", "0-27", "0-7", "0-8", "0-18", "0-116", "0-54", "0-19"] + [f"2-{i}" for i in range(1, 100000)]
In general i didn't understand the schema of the column_mapping configuration until i encountered errors so i think the logging aspect is important. I'm not an expert on collaborating in open-source development so forgive me if my attitude is naive or misguided. Thanks
e
Hi @Lior Naim Alon 👋 Thanks for considering contributing! Would a regular expression be better suited to validate that setting?
l
yes but i don't think the singer-SDK allows for regular-expressions in this field, it only tries to perform exact matching ( "=" )
e
Gotcha. The
StringType
helper actually supports a
pattern
parameter but it needs a newer version of the SDK: https://github.com/MeltanoLabs/target-hubspot/pull/24