Compare commits

..

2 Commits

Author SHA1 Message Date
github-actions[bot] 32487763d5 chore: version packages (#1043) 2025-12-03 14:52:26 -06:00
Daniel Bustamante Ospina 06c3c556e6 Add new fields to SpreadsheetParsingConfig and update validation tests (#1042) 2025-12-03 14:50:23 -06:00
8 changed files with 64 additions and 6 deletions
+6
View File
@@ -1,5 +1,11 @@
# llama-cloud-services-py
## 0.6.87
### Patch Changes
- 06c3c55: Update spreadsheet parsing config
## 0.6.86
### Patch Changes
+12 -1
View File
@@ -1,5 +1,6 @@
from datetime import datetime
from enum import Enum
from typing import Literal
from pydantic import BaseModel, ConfigDict, Field, field_validator
@@ -63,7 +64,7 @@ class SpreadsheetParseResult(BaseModel):
class SpreadsheetParsingConfig(BaseModel):
"""Configuration for spreadsheet parsing and region extraction"""
model_config = ConfigDict(extra="forbid")
model_config = ConfigDict(extra="ignore")
sheet_names: list[str] | None = Field(
default=None,
@@ -86,6 +87,16 @@ class SpreadsheetParsingConfig(BaseModel):
description="Enables experimental processing. Accuracy may be impacted.",
)
flatten_hierarchical_tables: bool = Field(
default=False,
description="Return a flattened dataframe when a detected table is recognized as hierarchical.",
)
table_merge_sensitivity: Literal["strong", "weak"] = Field(
default="strong",
description="Influences how likely similar-looking regions are merged into a single table. Useful for spreadsheets that either have sparse tables (strong merging) or many distinct tables close together (weak merging).",
)
class SpreadsheetJob(BaseModel):
"""A spreadsheet parsing job"""
+7
View File
@@ -1,5 +1,12 @@
# llama_parse
## 0.6.87
### Patch Changes
- Updated dependencies [06c3c55]
- llama-cloud-services-py@0.6.87
## 0.6.86
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "llama_parse",
"version": "0.6.86",
"version": "0.6.87",
"description": "",
"main": "index.js",
"private": false,
+2 -2
View File
@@ -11,13 +11,13 @@ dev = [
[project]
name = "llama-parse"
version = "0.6.86"
version = "0.6.87"
description = "Parse files into RAG-Optimized formats."
authors = [{name = "Logan Markewich", email = "logan@llamaindex.ai"}]
requires-python = ">=3.9,<4.0"
readme = "README.md"
license = "MIT"
dependencies = ["llama-cloud-services>=0.6.86"]
dependencies = ["llama-cloud-services>=0.6.87"]
[project.scripts]
llama-parse = "llama_parse.cli.main:parse"
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "llama-cloud-services-py",
"version": "0.6.86",
"version": "0.6.87",
"private": false,
"license": "MIT",
"scripts": {},
+1 -1
View File
@@ -23,7 +23,7 @@ dev = [
[project]
name = "llama-cloud-services"
version = "0.6.86"
version = "0.6.87"
description = "Tailored SDK clients for LlamaCloud services."
authors = [{name = "Logan Markewich", email = "logan@runllama.ai"}]
requires-python = ">=3.9,<4.0"
+34
View File
@@ -2,11 +2,45 @@ import os
import tempfile
import pytest
import pandas as pd
from pydantic import ValidationError
from llama_cloud_services.beta.sheets import LlamaSheets
from llama_cloud_services.beta.sheets.types import SpreadsheetParsingConfig
class TestSpreadsheetParsingConfig:
"""Unit tests for SpreadsheetParsingConfig."""
def test_default_values(self):
"""Test that default values are set correctly."""
config = SpreadsheetParsingConfig()
assert config.flatten_hierarchical_tables is False
assert config.table_merge_sensitivity == "strong"
def test_custom_values(self):
"""Test setting custom values for new fields."""
config = SpreadsheetParsingConfig(
flatten_hierarchical_tables=True,
table_merge_sensitivity="weak",
)
assert config.flatten_hierarchical_tables is True
assert config.table_merge_sensitivity == "weak"
def test_table_merge_sensitivity_validation(self):
"""Test that invalid table_merge_sensitivity values are rejected."""
with pytest.raises(ValidationError):
SpreadsheetParsingConfig(table_merge_sensitivity="invalid")
def test_unknown_fields_ignored(self):
"""Test that unknown fields are silently ignored."""
config = SpreadsheetParsingConfig(
unknown_field="test",
another_unknown=123,
)
assert not hasattr(config, "unknown_field")
assert not hasattr(config, "another_unknown")
@pytest.fixture
def sheets_client():
"""Create a LlamaSheets client for testing."""