Skip to content

Conversation

rkuo-danswer
Copy link
Contributor

Description

Refs https://linear.app/danswer/issue/DAN-1791/salesforce-correctness

How Has This Been Tested?

[Describe the tests you ran to verify your changes]

Backporting (check the box to trigger backport action)

Note: You have to check that the action passes, otherwise resolve the conflicts manually and tag the patches.

  • This PR should be backported (make sure to check that the backport attempt succeeds)
  • [Optional] Override Linear Check

Copy link

vercel bot commented Apr 11, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
internal-search ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 22, 2025 11:11pm

@rkuo-danswer rkuo-danswer marked this pull request as ready for review April 11, 2025 17:34
@rkuo-danswer rkuo-danswer requested a review from a team as a code owner April 11, 2025 17:34
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

This PR enhances the Salesforce connector by improving time filtering logic and object type handling for better data synchronization.

  • Changed fetch_all_csvs_in_parallel in salesforce_calls.py to use a dictionary parameter that explicitly maps object types to filtering preferences
  • Added new _get_all_types static method in connector.py to better separate concerns when collecting Salesforce object types
  • Implemented smarter time filtering that only applies filters to object types already present in the database
  • Removed commented-out code in sqlite_functions.py for better code cleanliness
  • Improved CSV information logging with detailed statistics about downloaded files

3 file(s) reviewed, 2 comment(s)
Edit PR Review Bot Settings | Greptile

because this occurs after we check for existing csvs which covers this case"""
all_types_to_filter: dict[str, bool] = {}
for sf_type in all_types:
if sf_db.has_at_least_one_object_of_type(sf_type):
Copy link
Contributor

Choose a reason for hiding this comment

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

slight preference for

all_types_to_filter[sf_type] = sf_db.has_at_least_one_object_of_type(sf_type)

@rkuo-danswer rkuo-danswer added this pull request to the merge queue Apr 19, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 19, 2025
@Weves Weves added this pull request to the merge queue Apr 20, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to no response for status checks Apr 21, 2025
@rkuo-danswer rkuo-danswer added this pull request to the merge queue Apr 24, 2025
Merged via the queue into main with commit c83ee06 Apr 24, 2025
11 checks passed
@rkuo-danswer rkuo-danswer deleted the feature/salesforce-correctness-2 branch April 24, 2025 01:58
aronszanto pushed a commit to aronszanto/onyx that referenced this pull request Apr 26, 2025
* refactor salesforce sqlite db access

* more refactoring

* refactor again

* refactor again

* rename object

* add finalizer to ensure db connection is always closed

* avoid unnecessarily nesting connections and commit regularly when possible

* remove db usage from csv download

* dead code

* hide deprecation warning in ddtrace

* remove unused param

---------

Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
AnkitTukatek pushed a commit to TukaTek/onyx that referenced this pull request Sep 23, 2025
* refactor salesforce sqlite db access

* more refactoring

* refactor again

* refactor again

* rename object

* add finalizer to ensure db connection is always closed

* avoid unnecessarily nesting connections and commit regularly when possible

* remove db usage from csv download

* dead code

* hide deprecation warning in ddtrace

* remove unused param

---------

Co-authored-by: Richard Kuo (Onyx) <rkuo@onyx.app>
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.

2 participants