langchain/libs/community/tests/integration_tests/document_loaders
Philippe PRADOS f3fb5a9c68
community[minor]: Fix json._validate_metadata_func() (#22842)
JSONparse, in _validate_metadata_func(), checks the consistency of the
_metadata_func() function. To do this, it invokes it and makes sure it
receives a dictionary in response. However, during the call, it does not
respect future calls, as shown on line 100. This generates errors if,
for example, the function is like this:
```python
        def generate_metadata(json_node:Dict[str,Any],kwargs:Dict[str,Any]) -> Dict[str,Any]:
             return {
                "source": url,
                "row": kwargs['seq_num'],
                "question":json_node.get("question"),
            }
        loader = JSONLoader(
            file_path=file_path,
            content_key="answer",
            jq_schema='.[]',
            metadata_func=generate_metadata,
            text_content=False)
```
To avoid this, the verification must comply with the specifications.
This patch does just that.

---------

Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com>
2024-12-13 21:24:20 +00:00
..
parsers
__init__.py
test_arxiv.py
test_astradb.py
test_bigquery.py
test_bilibili.py
test_blockchain.py
test_cassandra.py
test_confluence.py
test_couchbase.py
test_csv_loader.py
test_dataframe.py
test_dedoc.py community[minor]: added new document loaders based on dedoc library (#24303) 2024-07-23 02:04:53 +00:00
test_docusaurus.py
test_duckdb.py
test_email.py
test_etherscan.py
test_excel.py
test_facebook_chat.py
test_fauna.py
test_figma.py
test_geodataframe.py
test_gitbook.py
test_github.py
test_google_speech_to_text.py
test_ifixit.py
test_joplin.py
test_json_loader.py community[minor]: Fix json._validate_metadata_func() (#22842) 2024-12-13 21:24:20 +00:00
test_lakefs.py
test_language.py
test_larksuite.py
test_llmsherpa.py
test_mastodon.py
test_max_compute.py
test_modern_treasury.py
test_news.py
test_nuclia.py
test_odt.py
test_oracleds.py
test_org_mode.py
test_pdf.py community[patch]: add to pypdf tests and run in CI (#26663) 2024-09-19 14:45:49 +00:00
test_polars_dataframe.py
test_pubmed.py
test_pyspark_dataframe_loader.py
test_python.py
test_quip.py community[patch]: Add missing annotations (#24890) 2024-07-31 18:13:44 +00:00
test_recursive_url_loader.py
test_rocksetdb.py
test_rss.py
test_rst.py
test_sitemap.py
test_slack.py
test_spreedly.py
test_sql_database.py
test_stripe.py
test_telegram.py
test_tensorflow_datasets.py multiple: pydantic 2 compatibility, v0.3 (#26443) 2024-09-13 14:38:45 -07:00
test_tidb.py
test_tsv.py
test_unstructured.py
test_url_playwright.py
test_url.py
test_whatsapp_chat.py
test_wikipedia.py
test_xml.py
test_xorbits.py