-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adding an oop example #71
base: main
Are you sure you want to change the base?
Conversation
|
for table in selected_table: | ||
con = table(configuration=configuration) | ||
schema_dict = con.assign_schema() | ||
#print(f"Schema for table {con}: {schema_dict}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -0,0 +1,3 @@ | |||
{ | |||
"api_key": "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"api_key": "" | |
"api_key": "<YOUR_API_KEY>" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address above comments. Everything else looks good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please address the review comments
@@ -0,0 +1,3 @@ | |||
{ | |||
"api_key": "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@@ -0,0 +1,63 @@ | |||
import json |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add the comment here, like our other examples
from fivetran_connector_sdk import Connector | ||
from fivetran_connector_sdk import Operations as op | ||
from fivetran_connector_sdk import Logging as log |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add comments like out other examples
for table in selected_table: | ||
con = table(configuration=configuration) | ||
schema_dict = con.assign_schema() | ||
#print(f"Schema for table {con}: {schema_dict}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
print(f"Number of {endpoint} retrieved: {len(data[endpoint])}") | ||
except rq.exceptions.RequestException as e: | ||
# Handle exceptions and log a warning message | ||
log.warning(f"API request to {endpoint} failed: {e}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this will not work as you've not imported, please test it
from typing import List, Optional, Union | ||
from xml.sax.handler import property_encoding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks like they are not being used in this file.
Using the National Park Services API to use an OOP based logic to build the connector. This also has a new format with a Readme to walk through the code and show the output in the database itself vs in the code comments.