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

Adding an oop example #71

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Adding an oop example #71

wants to merge 2 commits into from

Conversation

orizwanft
Copy link
Collaborator

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.

Copy link

height bot commented Jan 8, 2025

Link Height tasks by mentioning a task ID in the pull request title or commit messages, or description and comments with the keyword link (e.g. "Link T-123").

💡Tip: You can also use "Close T-X" to automatically close a task when the pull request is merged.

for table in selected_table:
con = table(configuration=configuration)
schema_dict = con.assign_schema()
#print(f"Schema for table {con}: {schema_dict}")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove this comment

Copy link
Collaborator

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": ""
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"api_key": ""
"api_key": "<YOUR_API_KEY>"

Copy link
Collaborator

Choose a reason for hiding this comment

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

+1

Copy link
Collaborator

@fivetran-rishabhghosh fivetran-rishabhghosh left a 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

Copy link
Collaborator

@varundhall varundhall left a 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": ""
Copy link
Collaborator

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
Copy link
Collaborator

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

Comment on lines +2 to +4
from fivetran_connector_sdk import Connector
from fivetran_connector_sdk import Operations as op
from fivetran_connector_sdk import Logging as log
Copy link
Collaborator

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}")
Copy link
Collaborator

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}")
Copy link
Collaborator

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

Comment on lines +1 to +2
from typing import List, Optional, Union
from xml.sax.handler import property_encoding
Copy link
Collaborator

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.

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.

3 participants