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

Update test_sql_database.py #17097

Closed
wants to merge 0 commits into from

Conversation

ShorthillsAI
Copy link
Contributor

@ShorthillsAI ShorthillsAI commented Feb 6, 2024

In the previous function, db_chain.run is used to execute the chain, but in line number 79, only db_chain is called, which can lead to code inefficiency because it doesn't actually execute the chain. To ensure consistency, it's important to use the .run method consistently to execute the chain in all relevant parts of the code.

@dosubot dosubot bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Feb 6, 2024
Copy link

vercel bot commented Feb 6, 2024

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

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Mar 7, 2024 6:23am

@dosubot dosubot bot added 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs 🔌: chroma Primarily related to ChromaDB integrations labels Feb 6, 2024
@@ -77,7 +77,7 @@ def test_sql_database_sequential_chain_intermediate_steps() -> None:
db_chain = SQLDatabaseSequentialChain.from_llm(
OpenAI(temperature=0), db, return_intermediate_steps=True
)
output = db_chain("What company does Harrison work at?")
output = db_chain.run("What company does Harrison work at?")
Copy link
Collaborator

Choose a reason for hiding this comment

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

We generally prefer using .invoke rather than .run now

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eyurtsev, Understood, I have updated PR with .invoke now with all the found code that should be modified with the same.
Thanks

Copy link
Contributor Author

@ShorthillsAI ShorthillsAI Feb 7, 2024

Choose a reason for hiding this comment

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

@eyurtsev, I also see that a lint error comes up with this change. It seems like .invoke is expecting a non-string data type value, maybe a dict type.

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eyurtsev, What should we do here now, Based on the .invoke data type, .run can be implemented here. What's your suggestion?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@eyurtsev, Just a reminder, Should we revoke from .invoke to .run now?

@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:XS This PR changes 0-9 lines, ignoring generated files. labels Feb 7, 2024
@ShorthillsAI ShorthillsAI requested a review from eyurtsev March 7, 2024 06:23
@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: chroma Primarily related to ChromaDB integrations 🤖:nit Small modifications/deletions, fixes, deps or improvements to existing code or docs size:XS This PR changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants