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

Recurly #1058

Merged
merged 6 commits into from
Nov 25, 2020
Merged

Recurly #1058

merged 6 commits into from
Nov 25, 2020

Conversation

yevhenii-ldv
Copy link
Contributor

What

Add source connector for Recurly to load data.

Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

Small changes required but looks great so far.

@@ -0,0 +1,4 @@
{
"access_token": "<your access token>",
Copy link
Contributor

Choose a reason for hiding this comment

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

could you place this in the sample_configs directory and update it to match the spec.json file?

) -> Generator[AirbyteMessage, None, None]:
client = self._client(config_container)

catalog = AirbyteCatalog.parse_obj(self.read_config(catalog_path))
Copy link
Contributor

Choose a reason for hiding this comment

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

this object is now a ConfiguredAirbyteCatalog

Suggested change
catalog = AirbyteCatalog.parse_obj(self.read_config(catalog_path))
catalog = ConfiguredAirbyteCatalog.parse_obj(self.read_config(catalog_path))

Copy link
Contributor

Choose a reason for hiding this comment

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

See #1065 for an example of the necessary change here

"properties": {
"api_key": {
"type": "string",
"description": "Recurly API Key, use <a href=\"https://airbyte.recurly.com/integrations/api_keys\">admin</a> to generate this key."
Copy link
Contributor

Choose a reason for hiding this comment

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

current link points them to the Airbyte instance of recurly. Better to redirect to docs instead.

Suggested change
"description": "Recurly API Key, use <a href=\"https://airbyte.recurly.com/integrations/api_keys\">admin</a> to generate this key."
"description": "Recurly API Key. See the <a href=\"https://docs.airbyte.io/integrations/sources/recurly\">docs</a> for more information on how to generate this key."


### Output schema

Several output streams are available from this source (accounts, plans, invoices, transactions, etc.).
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you:

  1. List the entities output (instead of "etc.")
  2. Add a URL to the recurly docs that helps the user understand what each of these entities mean
Suggested change
Several output streams are available from this source (accounts, plans, invoices, transactions, etc.).
Several output streams are available from this source:
* accounts
* ....

return streams

def get_entities(self, entity_name):
if entity_name == "export_dates":
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you add a comment explaining why there is a special handling of this stream?

if resp.status_code == 200:
entity_data = resp.json()["data"]
while resp.json()["has_more"]:
resp = requests.get(f"{self.RECURLY_BASE_URL}{resp.json()['next']}", headers=self._headers)
Copy link
Contributor

Choose a reason for hiding this comment

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

is this correct? Recurly docs imply that the URL contained in next is complete and doesn't need to be appended to the base URL. To make sure that this is the case, is it possible to add a few hundred items to one of the streams just to future proof this? Ideally you can programmatically create 200 items in an entity via the API so it's not a ton of work on your end.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's correct, added 200+ coupons to test pagination.

"Content-Type": "application/json",
}

def health_check(self):
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use return signatures on all methods e.g:

Suggested change
def health_check(self):
def health_check(self) -> Tuple[Boolean, object]:

self._client = RecurlyClient(api_key)
self._headers = {
"User-Agent": USER_AGENT,
"Authorization": "Basic %s" % b64encode(bytes(api_key + ":", "ascii")).decode("ascii"),
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is it necessary to do this instead of just adding API key? Could you add a comment to the code so the context is not lost?

PAGINATION = 100

def __init__(self, api_key: str):
self.ENTITY_MAP = ["accounts", "coupons", "invoices", "plans", "measured_units", "subscriptions", "transactions", "export_dates"]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: If this is just a list then rename to ENTITIES

@@ -0,0 +1,62 @@
# Recurly Source
Copy link
Contributor

Choose a reason for hiding this comment

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

This readme looks out of date. Could you reference the latest template and update accordingly?

Copy link
Contributor

@sherifnada sherifnada left a comment

Choose a reason for hiding this comment

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

Nice work!

@sherifnada sherifnada merged commit 9b03389 into airbytehq:master Nov 25, 2020
davydov-d added a commit that referenced this pull request Dec 20, 2022
davydov-d added a commit that referenced this pull request Dec 21, 2022
davydov-d added a commit that referenced this pull request Feb 1, 2023
davydov-d added a commit that referenced this pull request Feb 1, 2023
davydov-d added a commit that referenced this pull request Feb 2, 2023
davydov-d added a commit that referenced this pull request Feb 2, 2023
* #1058 source mailchimp: add extra logs

* #1058 source mailchimp: upd changelog

* #1058 source mailchimp: flake fix

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
davydov-d added a commit that referenced this pull request Feb 6, 2023
davydov-d added a commit that referenced this pull request Feb 6, 2023
davydov-d added a commit that referenced this pull request Feb 6, 2023
* #1058 source Mailchimp: revert extra logging

* #1058 source Mailchimp: upd changelog

* auto-bump connector version

---------

Co-authored-by: Octavia Squidington III <octavia-squidington-iii@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants