Skip to content

Commit

Permalink
Merge pull request #1 from svinstech/update/remove-anyOf
Browse files Browse the repository at this point in the history
[DE-2698] Update/remove any of
  • Loading branch information
treeforest456 authored Nov 12, 2022
2 parents 7228b72 + 8c2c2c3 commit e8ec61e
Show file tree
Hide file tree
Showing 8 changed files with 88 additions and 154 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,28 @@ In practice, this means that prefacing commits with `feat:` will create a minor
### Running a GraphQL query locally

Use the [Anvil Postman collection](https://www.postman.com/useanvil/workspace/anvil/overview).


### Caveat

Previously for `CreatedAt`, `UpdatedAt` and some other date attribute, we have
```
"createdAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
]
},
```
this kind of type for them. Because we're using `target-snowflake` downstream of `tap-anvil` to load this data into our datawarehouse in Snowflake and there is a [known issue](https://github.com/transferwise/pipelinewise-target-snowflake/issues/228) in `target-snowflake` that it will skip `anyOf` type attribute. So we just make this a `string` type like below.
```
"type": [
"null",
"string"
]
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "tap-anvil"
version = "0.1.5"
version = "0.1.6"
description = "A Singer tap for Anvil, a tool for programmatically filling out PDF forms."
authors = ["Kshitij Aranke <[email protected]>"]
keywords = ["singer", "tap", "anvil"]
Expand Down
6 changes: 5 additions & 1 deletion tap_anvil/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@


class AnvilStream(GraphQLStream):
"""anvil stream class."""
"""
anvil stream class.
note: treat attributes like updatedAt as a string type
anyOf type will be ignored by target-snowflake
"""

url_base = "https://graphql.useanvil.com"
primary_keys = ["eid"]
Expand Down
44 changes: 12 additions & 32 deletions tap_anvil/schemas/forges.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@
]
},
"publishedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"hasUnpublishedChanges": {
Expand Down Expand Up @@ -82,36 +77,21 @@
]
},
"createdAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"updatedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"archivedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"examplePayload": {
Expand Down
22 changes: 6 additions & 16 deletions tap_anvil/schemas/organizations.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,15 @@
]
},
"createdAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"updatedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"subscribedPlanFeatures": {
Expand Down
33 changes: 9 additions & 24 deletions tap_anvil/schemas/submissions.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,36 +83,21 @@
]
},
"createdAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"updatedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"archivedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"weldDataEid": {
Expand Down
55 changes: 15 additions & 40 deletions tap_anvil/schemas/weldDatas.json
Original file line number Diff line number Diff line change
Expand Up @@ -113,58 +113,33 @@
]
},
"createdAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"updatedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"dataUpdatedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"expiresAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"archivedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"weldEid": {
Expand Down
55 changes: 15 additions & 40 deletions tap_anvil/schemas/welds.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,9 @@
]
},
"publishedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"hasUnpublishedChanges": {
Expand Down Expand Up @@ -100,47 +95,27 @@
]
},
"createdAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"updatedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"archivedAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"string"
]
},
"expiresAt": {
"anyOf": [
{
"type": "null"
},
{
"format": "date-time",
"type": "string"
}
"type": [
"null",
"object"
]
},
"organizationSlug": {
Expand Down

0 comments on commit e8ec61e

Please sign in to comment.