-
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
Add Toast example #70
base: main
Are you sure you want to change the base?
Conversation
|
to_ts = datetime.datetime.now(datetime.timezone.utc).isoformat("T", "milliseconds") | ||
if 'to_ts' in state: | ||
from_ts = state['to_ts'] |
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.
we can rename these variables for better code readability
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.
Names updated for both to_ts and from_ts.
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.
Just from reading these variables, it is not clear. Can we rename it to start_time
and end_time
or something similar?
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.
Updated to start_utc_timestamp and current_utc_timestamp.
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 testing details in PR description.
@@ -0,0 +1,202 @@ | |||
|
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 a line mentioning what this example does.
def update(configuration: dict, state: dict): | ||
|
||
try: | ||
conf = configuration |
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.
Any reason for introducing another variable?
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.
No reason - I've updated the code to just use the parameter name itself.
to_ts = datetime.datetime.now(datetime.timezone.utc).isoformat("T", "milliseconds") | ||
if 'to_ts' in state: | ||
from_ts = state['to_ts'] |
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.
Just from reading these variables, it is not clear. Can we rename it to start_time
and end_time
or something similar?
Also, please update the README file with the example details. |
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.
Almost there
fivetran_connector_sdk==0.13.10.1 | ||
Requests==2.32.3 |
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.
if these are the only 2 requirements then we can skip this file
"clientId": "", | ||
"clientSecret": "", | ||
"userAccessType": "", | ||
"domain": "" | ||
} |
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 placeholder text like our other examples
# - state: a dictionary contains whatever state you have chosen to checkpoint during the prior sync | ||
# The state dictionary is empty for the first sync or for any full re-sync | ||
def update(configuration: dict, state: 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.
please add the examples log, refer other examples
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.
Almost there, please address these minor comments
# This is an example to extract data from Toast, technology platform primarily designed for the restaurant industry. | ||
# It provides an all-in-one point-of-sale (POS) and management system tailored to meet the unique needs | ||
# of restaurants, cafes, and similar businesses. |
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 should go above the line 2 and 3, see other examples for reference
# from the correct position in case of interruptions. | ||
yield op.checkpoint(state) | ||
|
||
# The function takes six parameters: |
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.
we should be consistent in comments, please explain what this method does, can be a one-liner
Many customers are going to be asking for this for the Toast API. This is a very simple example and is not a replacement for the existing connector.