Skip to content
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 Dropbox connector #956

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Add Dropbox connector #956

wants to merge 5 commits into from

Conversation

goldflag
Copy link
Contributor

@goldflag goldflag commented Jan 17, 2024

image image image image

Copy link

vercel bot commented Jan 17, 2024

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 Jan 18, 2024 6:52am

Copy link
Contributor

@yuhongsun96 yuhongsun96 left a comment

Choose a reason for hiding this comment

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

Great work! Some minor additions needed to support a wider set of file types and handling file updates of the same file.

self.dropbox_client.sharing_create_shared_link_with_settings(path)
)
return link_metadata.url
except ApiError as err:
Copy link
Contributor

Choose a reason for hiding this comment

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

This will fail on the same doc if the doc is updated and an update is fetched via Danswer. The error is something like: CreateSharedLinkWithSettingsError('shared_link_already_exists') so we should first check if a shared link exists?

downloaded_file = self._download_file(entry.path_display)
link = self._get_shared_link(entry.path_display)
try:
text = downloaded_file.decode("utf-8")
Copy link
Contributor

Choose a reason for hiding this comment

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

We want to read the file extension and use different handling based on that. We can just assume that .pdf, .docx, .doc etc all follow their expected formats. There's another PR out right now which handles a few of these types, perhaps you can refactor their file handling code to cover these cases as well. Users will be upset if they end up missing a lot of files which they expect to get pulled in.

The important ones would be Doc, Docx, Txt, Excel, PDF, PPT. No need to address this yet though, let me review and merge the other PR first

)
)
except Exception as e:
print(
Copy link
Contributor

Choose a reason for hiding this comment

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

Here and in other places - We try not to use print anywhere, we have a standard logger that we import and use throughout

@@ -0,0 +1,202 @@
"use client";
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not well versed in frontend code but I don't think you need a review from Chris on this, the functionality is all good so I think the frontend code is safe to go in as is

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.

None yet

2 participants