mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-20 18:07:05 +00:00
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> |
||
---|---|---|
.. | ||
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 | ||
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 | ||
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 | ||
test_polars_dataframe.py | ||
test_pubmed.py | ||
test_pyspark_dataframe_loader.py | ||
test_python.py | ||
test_quip.py | ||
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 | ||
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 |