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

Improve discovery of graph schema using database statistics. Update documentation accordingly #19244

Closed
wants to merge 28 commits into from

Conversation

mhavey
Copy link
Contributor

@mhavey mhavey commented Mar 18, 2024

Thank you for contributing to LangChain!

  • Optimization schema discovery in Neptune RDF Graph: "community: improve discovery of graph schema using database statistics. Update documentation accordingly"

    • Where "package" is whichever of langchain, community, core, experimental, etc. is being modified. Use "docs: ..." for purely docs changes, "templates: ..." for template changes, "infra: ..." for CI changes.
    • Example: "community: add foobar LLM"
  • PR message: Delete this entire checklist and replace with

    • Description: a description of the change
    • Issue: the issue # it fixes, if applicable
    • Dependencies: any dependencies required for this change
    • Twitter handle: if your PR gets announced, and you'd like a mention, we'll gladly shout you out!
  • Add tests and docs: If you're adding a new integration, please include

    1. a test for the integration, preferably unit tests that do not rely on network access,
    2. an example notebook showing its use. It lives in docs/docs/integrations directory.
  • Lint and test: Run make format, make lint and make test from the root of the package(s) you've modified. See contribution guidelines for more: https://python.langchain.com/docs/contributing/

Additional guidelines:

  • Make sure optional dependencies are imported within a function.
  • Please do not add dependencies to pyproject.toml files (even optional ones) unless they are required for unit tests.
  • Most PRs should not touch more than one package.
  • Changes should be backwards compatible.
  • If you are adding something to community, do not re-import it in langchain.

If no one reviews your PR within a few days, please @-mention one of baskaryan, efriis, eyurtsev, hwchase17.

Copy link

vercel bot commented Mar 18, 2024

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

Name Status Preview Comments Updated (UTC)
langchain 🛑 Canceled (Inspect) Mar 27, 2024 3:19pm

@mhavey mhavey marked this pull request as ready for review March 20, 2024 17:14
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. 🤖:improvement Medium size change to existing code to handle new use-cases labels Mar 20, 2024
@mhavey mhavey marked this pull request as draft March 20, 2024 17:15
@mhavey
Copy link
Contributor Author

mhavey commented Mar 20, 2024

@3coins

Copy link
Contributor

@3coins 3coins left a comment

Choose a reason for hiding this comment

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

@mhavey
Thanks for making these changes. Left some suggestions to simplify the code. I can help fix the notebook lint issues, once you have made these updates.

Comment on lines 149 to 151
"GRAPH_NOTEBOOK_HOST= os.popen(\"source ~/.bashrc ; echo $GRAPH_NOTEBOOK_HOST\").read().split(\"\\n\")[0]\n",
"GRAPH_NOTEBOOK_PORT= os.popen(\"source ~/.bashrc ; echo $GRAPH_NOTEBOOK_PORT\").read().split(\"\\n\")[0]\n",
"[GRAPH_NOTEBOOK_HOST, GRAPH_NOTEBOOK_PORT]"
Copy link
Contributor

Choose a reason for hiding this comment

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

Would os.environ work here?

Suggested change
"GRAPH_NOTEBOOK_HOST= os.popen(\"source ~/.bashrc ; echo $GRAPH_NOTEBOOK_HOST\").read().split(\"\\n\")[0]\n",
"GRAPH_NOTEBOOK_PORT= os.popen(\"source ~/.bashrc ; echo $GRAPH_NOTEBOOK_PORT\").read().split(\"\\n\")[0]\n",
"[GRAPH_NOTEBOOK_HOST, GRAPH_NOTEBOOK_PORT]"
"import os\n\n",
"GRAPH_NOTEBOOK_HOST = os.environ.get(\"GRAPH_NOTEBOOK_HOST\")\n",
"GRAPH_NOTEBOOK_PORT = os.environ.get(\"GRAPH_NOTEBOOK_PORT\")\n\n",
"[GRAPH_NOTEBOOK_HOST, GRAPH_NOTEBOOK_PORT]"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

os.environ does not work for me. To simplify, I'll have the user enter these values.

Copy link
Contributor Author

@mhavey mhavey left a comment

Choose a reason for hiding this comment

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

Incorporating changes

@3coins
Copy link
Contributor

3coins commented Mar 26, 2024

@mhavey
Fixed lint errors and rebased your changes in PR 19546. Code looks good, can you make sure to test the latest version.

@mhavey
Copy link
Contributor Author

mhavey commented Mar 26, 2024

@3coins , tests successful on latest version, thanks

eyurtsev pushed a commit that referenced this pull request Mar 26, 2024
… of graph schema using database statistics (#19546)

Fixes linting for PR
[19244](#19244)

---------

Co-authored-by: mhavey <mchavey@gmail.com>
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Mar 27, 2024
@dosubot dosubot bot added size:S This PR changes 10-29 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Mar 27, 2024
@3coins
Copy link
Contributor

3coins commented Mar 27, 2024

@mhavey
Can you close this PR in favor of 19546 which was merged, so there is no confusion or any more commits to this. Thanks.

@mhavey mhavey closed this Mar 28, 2024
gkorland pushed a commit to FalkorDB/langchain that referenced this pull request Mar 30, 2024
… of graph schema using database statistics (langchain-ai#19546)

Fixes linting for PR
[19244](langchain-ai#19244)

---------

Co-authored-by: mhavey <mchavey@gmail.com>
hinthornw pushed a commit that referenced this pull request Apr 26, 2024
… of graph schema using database statistics (#19546)

Fixes linting for PR
[19244](#19244)

---------

Co-authored-by: mhavey <mchavey@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔌: aws Primarily related to Amazon Web Services (AWS) integrations 🤖:improvement Medium size change to existing code to handle new use-cases size:S This PR changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants