-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Salesforce make start_date
optional and change format to YYYY-MM-DD
#8191
Salesforce make start_date
optional and change format to YYYY-MM-DD
#8191
Conversation
@staticmethod | ||
def format_start_date(start_date): | ||
"""Transform the format `2021-07-25` into the format `2021-07-25T00:00:00Z`""" | ||
return pendulum.parse(start_date).strftime('%Y-%m-%dT%H:%M:%SZ') |
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.
What if start_date is None?
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.
@vitaliizazmic This case is fixed now.
/test connector=connectors/source-salesforce
|
"additionalProperties": false, | ||
"properties": { | ||
"client_id": { | ||
"title": "Client Id", |
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.
"title": "Client Id", | |
"title": "Client ID", |
"description": "Salesforce Refresh Token used for Airbyte to access your Salesforce account. If you don't know what this is, follow this <a href=\"https://medium.com/@bpmmendis94/obtain-access-refresh-tokens-from-salesforce-rest-api-a324fe4ccd9b\">guide</a> to retrieve it.", | ||
"type": "string", | ||
"airbyte_secret": true | ||
}, | ||
"start_date": { | ||
"description": "UTC date and time in the format 2017-01-25T00:00:00Z. Any data before this date will not be replicated. This field uses the \"updated\" field if available, otherwise the \"created\" fields if they are available for a stream.", | ||
"title": "Start Date", |
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.
"title": "Start Date", | |
"title": "Replication Start Date", |
"description": "Salesforce Refresh Token used for Airbyte to access your Salesforce account. If you don't know what this is, follow this <a href=\"https://medium.com/@bpmmendis94/obtain-access-refresh-tokens-from-salesforce-rest-api-a324fe4ccd9b\">guide</a> to retrieve it.", | ||
"type": "string", | ||
"airbyte_secret": true | ||
}, | ||
"start_date": { | ||
"description": "UTC date and time in the format 2017-01-25T00:00:00Z. Any data before this date will not be replicated. This field uses the \"updated\" field if available, otherwise the \"created\" fields if they are available for a stream.", | ||
"title": "Start Date", | ||
"description": "Date in the format 2017-01-25. Any data before this date will not be replicated. This field uses the \"updated\" field if available, otherwise the \"created\" fields if they are available for a stream.", |
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.
Can you also add a sentence like If not set, then by default all your data is replicated.
}, | ||
"is_sandbox": { | ||
"title": "Is Sandbox?", |
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.
"title": "Is Sandbox?", | |
"title": "Sandbox", |
}, | ||
"is_sandbox": { | ||
"title": "Is Sandbox?", | ||
"description": "Whether or not the the app is in a Salesforce sandbox. If you do not know what this, assume it is false. We provide more info on this field in the <a href=\"https://docs.airbyte.io/integrations/destinations/salesforce#is_sandbox\">docs</a>.", | ||
"type": "boolean", | ||
"default": false | ||
}, | ||
"api_type": { |
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.
can you create an issue to deprecate this option? this is an implementation detail that we should remove eventually
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.
@sherifnada It's created here
/test connector=connectors/source-salesforce
|
/publish connector=connectors/source-salesforce
|
/publish connector=connectors/source-salesforce
|
…airbytehq#8191) * Make `start_date` optional * start_date can take format `2021-07-25` * added title to all spec input properties and changed version in Dockerfile * added a new item into salesforce.md changelogs * fixed case when start_date is None * formatted code * changed comments in unit test fixtures * changed spec title fields * updated source and spec yaml Co-authored-by: Auganbay <[email protected]>
What
start_date
optionaltitle
anddescription
to all properties in Salesforce's input specHow
start_date
variable is used in the query and it is defined as:start_date = next_page_token or stream_date or self.start_date
self.start_date
is from the user input configThe solution provided here: if
start_date
is not None, then addWHERE {self.cursor_field} >= {start_date}
clause to the query, otherwise query will fetch all data without filtering by date (also there is a LIMIT clause).format_start_date
method will transform thestart_date
from format2021-07-25
into the format2021-07-25T00:00:00Z For backward compatibility, it works also with
start_date` which is entered in date time (YYYY-MM-DDTXX:XX:XXZ) format.title
for all properties inspec.json
file.Recommended reading order
x.java
y.python
🚨 User Impact 🚨
Are there any breaking changes? If yes, please make sure to include it here and in any changelogs with the 🚨🚨 emoji
What is the end result perceived by the user?
Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes