-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
module 'playwright.async_api' has no attribute 'AsyncBrowser' #21354
Labels
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
Comments
dosubot
bot
added
the
🤖:bug
Related to a bug, vulnerability, unexpected error with an existing feature
label
May 7, 2024
mehrdad-shokri
added a commit
to mehrdad-shokri/langchain
that referenced
this issue
May 7, 2024
…es for langchain-ai#21354 - Fix import class name exporeted from 'playwright.async_api' and 'playwright.sync_api' to match the correct name - Change import from inline guard_import to helper function that calls guard_import to make code more readable - Upgrade playwright version to 1.43.0
mehrdad-shokri
added a commit
to mehrdad-shokri/langchain
that referenced
this issue
May 8, 2024
…es for langchain-ai#21354 - Fix import class name exporeted from 'playwright.async_api' and 'playwright.sync_api' to match the correct name - Change import from inline guard_import to helper function that calls guard_import to make code more readable - Upgrade playwright version to 1.43.0
hwchase17
pushed a commit
that referenced
this issue
May 8, 2024
- **Description:** Fix import class name exporeted from 'playwright.async_api' and 'playwright.sync_api' to match the correct name in playwright tool. Change import from inline guard_import to helper function that calls guard_import to make code more readable in gmail tool. Upgrade playwright version to 1.43.0 - **Issue:** #21354 - **Dependencies:** upgrade playwright version(this is not required for the bugfix itself, just trying to keep dependencies fresh. I can remove the playwright version upgrade if you want.)
kyle-cassidy
pushed a commit
to kyle-cassidy/langchain
that referenced
this issue
May 10, 2024
- **Description:** Fix import class name exporeted from 'playwright.async_api' and 'playwright.sync_api' to match the correct name in playwright tool. Change import from inline guard_import to helper function that calls guard_import to make code more readable in gmail tool. Upgrade playwright version to 1.43.0 - **Issue:** langchain-ai#21354 - **Dependencies:** upgrade playwright version(this is not required for the bugfix itself, just trying to keep dependencies fresh. I can remove the playwright version upgrade if you want.)
kyle-cassidy
pushed a commit
to kyle-cassidy/langchain
that referenced
this issue
May 16, 2024
- **Description:** Fix import class name exporeted from 'playwright.async_api' and 'playwright.sync_api' to match the correct name in playwright tool. Change import from inline guard_import to helper function that calls guard_import to make code more readable in gmail tool. Upgrade playwright version to 1.43.0 - **Issue:** langchain-ai#21354 - **Dependencies:** upgrade playwright version(this is not required for the bugfix itself, just trying to keep dependencies fresh. I can remove the playwright version upgrade if you want.)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checked other resources
Example Code
Error Message and Stack Trace (if applicable)
"module 'playwright.async_api' has no attribute 'AsyncBrowser'"
Description
After 1 hour of investigation here is my findings:
Browser as AsyncBrowser
Browser as SyncBrowser
in the past but this PR broke it.lazy_import_playwright_browsers
usesguard_import
for both of the browsers(although the name of the class called from the module is incorrect), but stillguard_import
is called insidevalidate_browser_provided
andfrom_browser
again. These 2 functions can just calllazy_import_playwright_browsers
instead of repeating your self 6 times. Just calllazy_import_playwright_browsers
inside the mentions methods.lazy_import_playwright_browsers
body should look like:libs/community/langchain_community/tools/gmail/utils.py
changes introduced by the commit:All the import functions
import_googleapiclient_resource_builder
,import_google
,import_installed_app_flow
were changed to useguard_import
but later in the body of the functionsget_gmail_credentials
build_resource_service
instead of using these functions,guard_import
were called again(instead of just calling the import functions directly) to import classes from google libraries. this is obviously a code smell.I can submit a PR for this
System Info
The text was updated successfully, but these errors were encountered: