Skip to content

Commit fd49f92

Browse files
authored
🐛 Source Hubspot: fix casting of float numbers (#11105)
* upd documentation * fix comma in float number * bump version * add unit test for float casting * bump version
1 parent eced94a commit fd49f92

File tree

6 files changed

+52
-40
lines changed

6 files changed

+52
-40
lines changed

airbyte-config/init/src/main/resources/seed/source_definitions.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@
328328
- name: HubSpot
329329
sourceDefinitionId: 36c891d9-4bd9-43ac-bad2-10e12756272c
330330
dockerRepository: airbyte/source-hubspot
331-
dockerImageTag: 0.1.47
331+
dockerImageTag: 0.1.48
332332
documentationUrl: https://docs.airbyte.io/integrations/sources/hubspot
333333
icon: hubspot.svg
334334
sourceType: api

airbyte-config/init/src/main/resources/seed/source_specs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3331,7 +3331,7 @@
33313331
supportsNormalization: false
33323332
supportsDBT: false
33333333
supported_destination_sync_modes: []
3334-
- dockerImage: "airbyte/source-hubspot:0.1.47"
3334+
- dockerImage: "airbyte/source-hubspot:0.1.48"
33353335
spec:
33363336
documentationUrl: "https://docs.airbyte.io/integrations/sources/hubspot"
33373337
connectionSpecification:

airbyte-integrations/connectors/source-hubspot/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,5 @@ COPY source_hubspot ./source_hubspot
3434
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
3535
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]
3636

37-
LABEL io.airbyte.version=0.1.47
37+
LABEL io.airbyte.version=0.1.48
3838
LABEL io.airbyte.name=airbyte/source-hubspot

airbyte-integrations/connectors/source-hubspot/source_hubspot/streams.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ def _cast_value(cls, declared_field_types: List, field_name: str, field_value: A
425425
if target_type_name == "number":
426426
# do not cast numeric IDs into float, use integer instead
427427
target_type = int if field_name.endswith("_id") else target_type
428+
field_value = field_value.replace(",", "")
428429

429430
if target_type_name != "string" and field_value == "":
430431
# do not cast empty strings, return None instead to be properly casted.

airbyte-integrations/connectors/source-hubspot/unit_tests/test_field_type_converting.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ def test_bad_field_type_converting(field_type, expected, caplog, capsys):
5959
# specific cases
6060
("string", "some_field", "test", None, "test"),
6161
(["null", "number"], "some_field", "123.456", None, 123.456),
62+
(["null", "number"], "some_field", "123,123.456", None, 123123.456),
6263
(["null", "number"], "user_id", "123", None, 123),
6364
(["null", "string"], "some_field", "123", None, "123"),
6465
# when string has empty field_value (empty string)

0 commit comments

Comments
 (0)