Skip to content

Commit

Permalink
Cleanup conditional, and allow an index without terms as well as an i…
Browse files Browse the repository at this point in the history
…ndex with no terms
  • Loading branch information
macmv committed Dec 8, 2022
1 parent b03d701 commit fbdd88f
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,9 @@ def discover(self, logger: AirbyteLogger, config: json) -> AirbyteCatalog:
if (
type(source) is Ref
and source.collection() == Ref("collections")
# If either of these are missing, the index has no terms or values
and "terms" in index
and "values" in index
# Index must have 2 values and no terms
and len(index["values"]) == 2
and len(index["terms"]) == 0
and ("values" in index and len(index["values"]) == 2)
and (("terms" in index and len(index["terms"]) == 0) or "terms" not in index)
# Index values must be ts and ref
and index["values"][0] == {"field": "ts"}
and index["values"][1] == {"field": "ref"}
Expand Down

0 comments on commit fbdd88f

Please sign in to comment.