-
Notifications
You must be signed in to change notification settings - Fork 71
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
TDL-26523: Upgrade salesforce API version to v61 #184
base: master
Are you sure you want to change the base?
Conversation
@@ -62,29 +62,25 @@ jobs: | |||
path: test_output/report.xml | |||
- store_artifacts: | |||
path: htmlcov | |||
run_integration_tests: |
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.
In the parallel run, tests are failing. Switching them to run in a serialized manner.
In the current version of the tap, are these streams able to extract records? |
@@ -111,6 +112,12 @@ | |||
'FlowVariableView', | |||
'AppTabMember', | |||
'ColorDefinition', | |||
'DatacloudDandBCompany', # Not filterable without a criteria. |
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.
Not filterable without a criteria
Is the comment Correct here?
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 is an error message I have added over here. General comment is already written on top of this list
@@ -235,7 +243,7 @@ def __init__(self, | |||
self.rest_requests_attempted = 0 | |||
self.jobs_completed = 0 | |||
self.login_timer = None | |||
self.data_url = "{}/services/data/v52.0/{}" | |||
self.data_url = "{}/services/data/v61.0/{}" |
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.
define a constant for this version number and utilize it in the tap
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.
I think constant is not required here because It is just used for a single time in this module.
tap_salesforce/salesforce/bulk.py
Outdated
@@ -41,7 +41,7 @@ def find_parent(stream): | |||
|
|||
class Bulk(): | |||
|
|||
bulk_url = "{}/services/async/52.0/{}" | |||
bulk_url = "{}/services/async/61.0/{}" |
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.
define a constant for this version number and utilize it in the tap
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.
I think constant is not required here because It is just used for a single time in this module.
tap_salesforce/salesforce/rest.py
Outdated
@@ -28,7 +28,7 @@ def _query_recur( | |||
end_date=None, | |||
retries=MAX_RETRIES): | |||
params = {"q": query} | |||
url = "{}/services/data/v52.0/queryAll".format(self.sf.instance_url) | |||
url = "{}/services/data/v61.0/queryAll".format(self.sf.instance_url) |
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.
define a constant for this version number and utilize it in the tap
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.
I think constant is not required here because It is just used for a single time in this module.
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.
since this version is referenced multiple times, create a single constant where it can be referenced in all the modules.
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.
Done, I have added a constant for the API version and utilized it for all other places.
'IdentityProviderEventStore': default_full, # new | ||
'IdentityVerificationEvent': default_full, # new |
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 provide link to the documentation of the streams that have changed replication methods
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.
There is no documentation link for replication of these objects. Only when we run sync mode will we be able to know this behavior.
Please add a changelog and version bump in the PR |
…//github.com/singer-io/tap-salesforce into TDL-26523/upgrade-api-version-from-52-to-v61
@@ -199,6 +206,7 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches | |||
|
|||
return property_schema, mdata | |||
|
|||
#pylint: disable=too-many-positional-arguments |
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.
I was skimming this PR and thought it was weird to disable a linter for the whole class. So I just wanted to note that this class level disable is to fix things for just two methods.
Here's a pylint
run after deleting this line:
$ pylint tap_salesforce -d 'broad-except,broad-exception-caught,broad-exception-raised,chained-comparison,empty-docstring,fixme,invalid-name,line-too-long,missing-class-docstring,missing-function-docstring,missing-module-docstring,no-else-raise,no-else-return,too-few-public-methods,too-many-arguments,too-many-branches,too-many-lines,too-many-locals,ungrouped-imports,wrong-spelling-in-comment,wrong-spelling-in-docstring,consider-using-f-string,logging-fstring-interpolation,wrong-import-order,stop-iteration-return,logging-format-interpolation'
************* Module tap_salesforce.salesforce
tap_salesforce/salesforce/__init__.py:211:4: R0917: Too many positional arguments (12/5) (too-many-positional-arguments)
tap_salesforce/salesforce/__init__.py:292:4: R0917: Too many positional arguments (7/5) (too-many-positional-arguments)
-------------------------------------------------------------------
Your code has been rated at 9.98/10 (previous run: 10.00/10, -0.02)
And here's the changes to get this back to a 10/10 rating
diff --git a/tap_salesforce/salesforce/__init__.py b/tap_salesforce/salesforce/__init__.py
index f144b53..2a334cc 100644
--- a/tap_salesforce/salesforce/__init__.py
+++ b/tap_salesforce/salesforce/__init__.py
@@ -206,9 +206,8 @@ def field_to_property_schema(field, mdata): # pylint:disable=too-many-branches
return property_schema, mdata
-#pylint: disable=too-many-positional-arguments
class Salesforce():
- # pylint: disable=too-many-instance-attributes,too-many-arguments
+ # pylint: disable=too-many-instance-attributes,too-many-arguments,too-many-positional-arguments
def __init__(self,
refresh_token=None,
token=None,
@@ -284,7 +283,7 @@ class Salesforce():
self.quota_percent_per_run)
raise TapSalesforceQuotaExceededException(partial_message)
- # pylint: disable=too-many-arguments
+ # pylint: disable=too-many-arguments,too-many-positional-arguments
@backoff.on_exception(backoff.expo,
(requests.exceptions.ConnectionError, requests.exceptions.Timeout),
max_tries=10,
Maybe we should open a separate issue to clean up some of these inline disables. For example, too-many-arguments
appears in $PYLINT_DISABLE_LIST
and doesn't need to be inlined anymore
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.
Moved these class level inline pylint disables to function level. Created separate ticket to clean these inline disables - TDL-26624
@@ -3,7 +3,7 @@ | |||
from setuptools import setup | |||
|
|||
setup(name='tap-salesforce', | |||
version='2.0.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.
This P.R qualify's for a minor version release, since we are changing a lot of things.
I will suggest to use 2.1.0
over 2.0.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.
Agree. I have updated it
Description of change
Although the following streams are listed as supported for Bulk API in the current version of the tap, they are not functioning as expected with the Bulk sync. So, will skip these streams in Bulk Sync
QA steps
Risks
Rollback steps
AI generated code
https://internal.qlik.dev/general/ways-of-working/code-reviews/#guidelines-for-ai-generated-code