-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
🎉 Source Salesforce: add optional parameters to filter properties within streams #9931
Conversation
Hey, thanks for the contribution can you sourceAcceptanceTests screenshot? |
@harshithmullapudi |
Question for maintainers |
airbyte-integrations/connectors/source-salesforce/source_salesforce/source.py
Outdated
Show resolved
Hide resolved
airbyte-integrations/connectors/source-salesforce/source_salesforce/spec.json
Show resolved
Hide resolved
There is some conflicts because other code was merged, can you solved it @jkaelin ? |
@marcosmarxm made the changes you requested & rebased to latest. |
@marcosmarxm anything else you need me to address here? |
I'll test your code tomorrow @jkaelin ! |
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.
Thanks for this contribution! I slightly changed the custom exception you tried to raise, which broke the test.
@misteryeo / @sherifnada, please give this a quick review as the spec.json
was updated: two new optional fields.
try: | ||
exclude_stream_name, exclude_field_name = stream_field.split(".") | ||
except ValueError: | ||
raise f"Format for excluded field [{stream_field}] is incorrect. Expected format is Stream.Field" |
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.
raise f"Format for excluded field [{stream_field}] is incorrect. Expected format is Stream.Field" | |
raise Exception(f"Format for excluded field [{stream_field}] is incorrect. Expected format is Stream.Field") |
This leads to TypeError: exceptions must derive from BaseException
, please raise a valid Exception.
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 made the change in 8092db2
if config.get("exclude_fields") and stream_name is not None: | ||
for stream_field in config["exclude_fields"]: |
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 config.get("exclude_fields") and stream_name is not None: | |
for stream_field in config["exclude_fields"]: | |
if stream_name: | |
for stream_field in config.get("exclude_fields",[]): |
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 made the change in 8092db2
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.
LGTM!
Don't think this is blocking but I'm curious why the implementation here is just a field and not the variable input that we currently have for "Streams Filter Criteria" https://share.getcloudapp.com/P8u6njow |
@misteryeo - I just wanted to address your question directly based on my experience as a user. I did implement this feature using the compound-type input initially but the management was overly cumbersome. The main issue I have with that style input is the lack of a meaningful preview (e.g. seeing Having three of these compound-type inputs takes up a lot of screen real estate to effectively show a count to the user. If it offered some type of auto-complete or dynamic drop-down schema discovery then I'd be all over it. I started working on a spec extension to drive some ability to define how labels should be rendered. But when I saw this array implementation, it looked like an ideal UX for these parameters. The Here's an example from one of my sources to illustrate the usefulness and accessibility of these fields: |
Hey @jkaelin an other PR was merged on this connector, leading to multiple conflicts, do you mind fixing these? |
Hi @jkaelin, we closed this PR as we did not receive updates following our latest interactions. You are welcome to re-open it as soon as you want. We’ll be happy to give additional reviews. Do not hesitate to reach our team on Slack if you need support finishing this work. |
What
Allows a user to exclude specific fields and/or data-types from the stream.
Current Issues
There are at least a few issues directly requesting the generic ability to exclude specific fields from streams:
I acknowledge that this PR is specific to the Salesforce Source and does not fully address the above issues.
General Use Cases
Some use cases that may be faciliated by this PR:
base64
/object
)Specific Use Case
The immediate use case being solved for with this implementation is the ability to exclude certain calculated fields within Salesforce objects that may generate exceptions on evaluation. Although these exceptions are effectively masked in the UI, they will cause the Salesforce Bulk API to fail with only a generic error message.
How
generate_schema
Recommended reading order
spec.json
exclude_fields
&exclude_types
source.py
get_user_excluded_fields
&get_user_excluded_types
generate_streams
api.py
:generate_schema
api.py
generate_schema
unit_test.py
test_bulk_sync_pagination
#noqa E203
directive due to conflict betweenblack
&flake8
on line 143test_schema_with_user_excluded_fields
test_schema_with_user_excluded_types
User Impact
Pre-merge Checklist
Updating 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 here