Skip to content

Commit

Permalink
fix flake tests
Browse files Browse the repository at this point in the history
  • Loading branch information
samos123 committed Feb 15, 2023
1 parent a2776d1 commit ef43e5a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#

import hashlib
import re
import uuid
import hashlib
from typing import Any, Mapping

from airbyte_cdk.models import ConfiguredAirbyteCatalog
Expand Down Expand Up @@ -67,9 +67,7 @@ def get_schema_from_catalog(configured_catalog: ConfiguredAirbyteCatalog) -> Map
for k, v in stream.stream.json_schema.get("properties").items():
stream_schema[k] = "default"
if "array" in v.get("type", []) and (
"object" in v.get("items", {}).get("type", []) or
"array" in v.get("items", {}).get("type", []) or
v.get("items", {}) == {}
"object" in v.get("items", {}).get("type", []) or "array" in v.get("items", {}).get("type", []) or v.get("items", {}) == {}
):
stream_schema[k] = "jsonify"
if "object" in v.get("type", []):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)
from destination_weaviate import DestinationWeaviate
from destination_weaviate.client import Client, WeaviatePartialBatchError
from destination_weaviate.utils import stream_to_class_name, get_schema_from_catalog
from destination_weaviate.utils import get_schema_from_catalog, stream_to_class_name


@pytest.fixture(name="config")
Expand Down Expand Up @@ -514,7 +514,7 @@ def test_missing_fields(config: Mapping, client: Client):
class_name = stream_to_class_name(stream_name)
assert count_objects(client, class_name) == 1, "There should be only 1 object of in Weaviate"
actual = get_objects(client, class_name)[0]
assert actual["properties"].get("arr") == None
assert actual["properties"].get("arr") is None


def test_record_additional_properties(config: Mapping, client: Client):
Expand Down

0 comments on commit ef43e5a

Please sign in to comment.