Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DE-2698] Update/remove any of #1

Merged
merged 4 commits into from
Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if this is the only place that need to update? is there any other actions needed?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's it, we're installing from main AFAIK anyway, no?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah so we do need to update in airflow too and create the tag/release

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so that's after we merge this and then click on the create a new release here?
Screenshot 2022-11-11 at 3 55 49 PM

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah!

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