repo_id
stringclasses
409 values
prefix
large_stringlengths
34
36.3k
target
large_stringlengths
1
498
assertion_type
stringclasses
31 values
difficulty
stringclasses
8 values
test_file
stringlengths
10
121
test_function
stringlengths
1
104
test_class
stringlengths
0
51
lineno
int32
2
11.3k
commit_idx
int32
betodealmeida/shillelagh
import json import subprocess import sys import apsw import pytest from pytest_mock import MockerFixture from shillelagh.adapters.registry import AdapterLoader from shillelagh.backends.apsw.db import connect from shillelagh.exceptions import ProgrammingError from shillelagh.functions import date_trunc, get_metadata, ...
ValueError)
pytest.raises
variable
tests/functions_test.py
test_date_trunc
104
null
betodealmeida/shillelagh
from datetime import datetime, timedelta, timezone from typing import Any import pytest from pytest_mock import MockerFixture from requests import Session from requests_mock.mocker import Mocker from shillelagh.adapters.api.weatherapi import WeatherAPI, combine_time_filters from shillelagh.backends.apsw.db import con...
1
assert
numeric_literal
tests/adapters/api/weatherapi_test.py
test_dispatch_api_key_connection
617
null
betodealmeida/shillelagh
from datetime import date import pytest from pytest_mock import MockerFixture from requests import Session from requests_mock.mocker import Mocker from shillelagh.adapters.api.socrata import Number, SocrataAPI from shillelagh.backends.apsw.db import connect from shillelagh.exceptions import ProgrammingError from shil...
[]
assert
collection
tests/adapters/api/socrata_test.py
test_socrata_no_data
155
null
betodealmeida/shillelagh
from inspect import isfunction, ismethod import pytest from shillelagh.backends.apsw import db as dbapi def test_module_interface() -> None: """ Test constructors, globals, and exceptions. """ # constructors assert isfunction(dbapi.connect) # globals assert dbapi.apilevel ==
"2.0"
assert
string_literal
tests/backends/apsw/dbapi_test.py
test_module_interface
20
null
betodealmeida/shillelagh
import pytest from shillelagh.adapters.api.gsheets.parsing.base import tokenize from shillelagh.adapters.api.gsheets.parsing.number import ( AT, COLOR, COMMA, DIGITS, FRACTION, LITERAL, PERCENT, PERIOD, STAR, UNDERSCORE, E, InvalidValue, condition_matches, fix_pe...
3
assert
numeric_literal
tests/adapters/api/gsheets/parsing/number_test.py
test_digits_token
49
null
betodealmeida/shillelagh
from collections import defaultdict from multicorn import Qual, SortKey from pytest_mock import MockerFixture from shillelagh.adapters.registry import AdapterLoader from shillelagh.backends.multicorn.fdw import ( MulticornForeignDataWrapper, get_all_bounds, ) from shillelagh.filters import Operator from ...f...
(666, 200)
assert
collection
tests/backends/multicorn/fdw_test.py
test_get_rel_Size
212
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from returns.result import Failure, Success from boring_semantic_layer.utils import expr_to_ibis_string, ibis_string_to_expr from boring_semantic_layer.xorq_convert import ( from_tagged, serialize_dimensions, serialize_measures, to_tagged, try_impor...
"day"
assert
string_literal
src/boring_semantic_layer/tests/test_xorq_convert.py
test_serialize_dimensions_with_metadata
112
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
"bar"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_backends.py
test_bar_chart_categorical
TestPlotlyChartTypes
137
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """Create an in-memory DuckDB connection.""" return ibis.duckdb.connect(":memory:") def flights(con): """Create a sample flights table for testing.""" df = pd.DataFrame( { ...
"AA"
assert
string_literal
src/boring_semantic_layer/tests/test_filter_with_dimensions.py
test_filter_then_with_measures
82
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table, to_untagged pytestmark = pytest.mark.xfail( reason="Projection pushdown disabled for xorq vendored ibis compatibility" ) def duckdb_con(): """Create a DuckDB connection for testing.""" return ibis.duckdb.co...
sql3
assert
variable
src/boring_semantic_layer/tests/test_rewrites_projection_pushdown.py
test_projection_pushdown_three_way_join_all_notations
468
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
comp
assert
variable
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_multi_row_becomes_chart
TestResultToComponent
201
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
2
assert
numeric_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_blank_line_creates_new_row
TestMarkdownParser
77
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestNestedSubtotals: def test_temporal_hierarchy_year_month_day(self): """Test year → month → day hierarchical aggregation.""" con = ibis.duckdb.connect(":memory:") ...
4
assert
numeric_literal
src/boring_semantic_layer/tests/test_malloy_inspired.py
test_temporal_hierarchy_year_month_day
TestNestedSubtotals
238
null
boringdata/boring-semantic-layer
import os import tempfile import ibis import pytest from boring_semantic_layer import SemanticTable, from_config, from_yaml def duckdb_conn(): """Create a DuckDB connection for testing.""" return ibis.duckdb.connect() def sample_tables(duckdb_conn): """Create sample tables for testing.""" # Create c...
"A"
assert
string_literal
src/boring_semantic_layer/tests/test_yaml.py
test_database_kwarg_does_not_mutate_shared_tables
1,158
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
"date"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_detect_time_dimension_from_dtype_datetime64
TestDimensionUtils
92
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqIntegration: def test_xorq_expression_execution(self): """Test that converted xorq expression can be execu...
[1, 2, 3]
assert
collection
src/boring_semantic_layer/tests/test_xorq_integration.py
test_xorq_expression_execution
TestXorqIntegration
75
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
"text"
assert
string_literal
src/boring_semantic_layer/chart/tests/test_backends.py
test_single_value_indicator
TestAltairChartTypes
66
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch class TestDisplayThinking: def test_display_thinking_dim_italic(self): """Test that thinking text is displayed in dim italic.""" from boring_semantic_layer.agents.chats.cli import display_thinking with patch("boring_semantic_layer.agents.chats.cli.con...
call_kwargs["style"]
assert
complex_expr
src/boring_semantic_layer/agents/tests/test_chats_cli.py
test_display_thinking_dim_italic
TestDisplayThinking
127
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from returns.result import Failure, Success from boring_semantic_layer.utils import expr_to_ibis_string, ibis_string_to_expr from boring_semantic_layer.xorq_convert import ( from_tagged, serialize_dimensions, serialize_measures, to_tagged, try_impor...
[]
assert
collection
src/boring_semantic_layer/tests/test_xorq_convert.py
test_serialize_measures_with_metadata
144
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """Create an in-memory DuckDB connection.""" return ibis.duckdb.connect(":memory:") def flights(con): """Create a sample flights table for testing.""" df = pd.DataFrame( { ...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_filter_with_dimensions.py
test_filter_then_with_dimensions
58
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_unnest_preserves_other_columns(): """Test that unnesting preserves other columns correctly.""" con = ibis.duckdb.connect(":memory:") data = pd.DataFrame( { "session_id": [1, 2], ...
"Bob"
assert
string_literal
src/boring_semantic_layer/tests/test_unnest.py
test_unnest_preserves_other_columns
143
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table, to_untagged pytestmark = pytest.mark.xfail( reason="Projection pushdown disabled for xorq vendored ibis compatibility" ) def duckdb_con(): """Create a DuckDB connection for testing.""" return ibis.duckdb.co...
sql
assert
variable
src/boring_semantic_layer/tests/test_rewrites_projection_pushdown.py
test_projection_pushdown_with_measure_referencing_columns
227
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestSafeAggregationPatterns: def models(self): """Reuse the fan-out fixture: orders → line_items.""" con = ibis.duckdb.connect(":memory:") orders_tbl = con.create_ta...
9
assert
numeric_literal
src/boring_semantic_layer/tests/test_bi_traps.py
test_safe_pattern_measures_at_leaf_level
TestSafeAggregationPatterns
645
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
True
assert
bool_literal
src/boring_semantic_layer/tests/test_semantic_mcp.py
test_get_model_with_time_dimension
TestGetModel
148
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
1
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_json_filters
TestJSONStringParsing
181
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
tool
assert
variable
src/boring_semantic_layer/agents/tests/test_tools.py
test_tool_definitions_openai_format
TestToolDefinitions
35
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
True
assert
bool_literal
src/boring_semantic_layer/chart/tests/test_utils.py
test_has_time_dimension_true
TestDimensionUtils
60
null
boringdata/boring-semantic-layer
import json from unittest.mock import Mock, patch import pandas as pd import pytest from boring_semantic_layer.agents.utils.chart_handler import generate_chart_with_data def mock_query_result(): """Create a mock query result with execute() method.""" mock_result = Mock() df = pd.DataFrame({"origin": ["AT...
1
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_chart_handler.py
test_single_row_result_hides_chart
184
null
boringdata/boring-semantic-layer
import pytest import pandas as pd from boring_semantic_layer.chart.echarts import ( EChartsBackend, EChartsChartType, EChartsOption, DEFAULT_COLOR_PALETTE, ) class TestEChartsBackend: def backend(self): """Create an EChartsBackend instance.""" return EChartsBackend() def samp...
3
assert
numeric_literal
src/boring_semantic_layer/chart/tests/test_echarts_backend.py
test_generate_pie_chart
TestEChartsBackend
113
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
1
assert
numeric_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_extract_single_block
TestMarkdownParser
32
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
data
assert
variable
src/boring_semantic_layer/agents/tests/test_semantic_mcp.py
test_query_with_prefixed_fields_on_standalone_model
TestQueryModel
243
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
0
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_end_to_end_claude_desktop_query
TestIntegration
362
null
boringdata/boring-semantic-layer
import pandas as pd import pytest from boring_semantic_layer.chart.utils import ( clean_field_name, convert_datetime_to_strings, detect_chart_type_generic, detect_time_dimension_from_dtype, get_non_time_dimensions, has_time_dimension, melt_dataframe_for_multiple_measures, pivot_datafram...
(2, 2)
assert
collection
src/boring_semantic_layer/chart/tests/test_utils.py
test_pivot_dataframe_for_heatmap
TestDataFrameUtils
187
null
boringdata/boring-semantic-layer
import sys import tempfile from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent.parent / "docs" / "md")) from validate_links import ( extract_markdown_links, extract_routes_from_app_tsx, validate_links, ) class TestExtractMarkdownLinks: def test_de...
{"/path"}
assert
collection
src/boring_semantic_layer/chart/tests/test_doc_builder.py
test_deduplicate_links
TestExtractMarkdownLinks
88
null
boringdata/boring-semantic-layer
import ibis import json import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.Data...
None
assert
none_literal
src/boring_semantic_layer/chart/tests/test_echarts.py
test_basic_bar_chart
TestEChartsBasicCharts
75
null
boringdata/boring-semantic-layer
import pytest import pandas as pd from boring_semantic_layer.chart.echarts import ( EChartsBackend, EChartsChartType, EChartsOption, DEFAULT_COLOR_PALETTE, ) class TestEChartsBackend: def backend(self): """Create an EChartsBackend instance.""" return EChartsBackend() def samp...
True
assert
bool_literal
src/boring_semantic_layer/chart/tests/test_echarts_backend.py
test_multi_series_legend
TestEChartsBackend
230
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
1
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_tools.py
test_query_model_raises_tool_exception_on_error
TestBSLToolsQueryModel
337
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_percent_of_total_grand_total(): con = ibis.duckdb.connect(":memory:") flights = pd.DataFrame({"carrier": ["AA", "AA", "UA", "DL", "DL", "DL"]}) carriers = pd.DataFrame( {"code": ["AA", "UA", ...
v)
pytest.approx
variable
src/boring_semantic_layer/tests/test_percent_of_total.py
test_percent_of_total_grand_total
38
null
boringdata/boring-semantic-layer
import os import tempfile import ibis import pytest from boring_semantic_layer import SemanticTable, from_config, from_yaml def duckdb_conn(): """Create a DuckDB connection for testing.""" return ibis.duckdb.connect() def sample_tables(duckdb_conn): """Create sample tables for testing.""" # Create c...
"B"
assert
string_literal
src/boring_semantic_layer/tests/test_yaml.py
test_multiple_models_different_databases_same_table
1,212
null
boringdata/boring-semantic-layer
import sys import tempfile from pathlib import Path import pytest sys.path.insert(0, str(Path(__file__).parent.parent.parent.parent.parent / "docs" / "md")) from validate_links import ( extract_markdown_links, extract_routes_from_app_tsx, validate_links, ) class TestExtractRoutesFromAppTsx: def test...
{}
assert
collection
src/boring_semantic_layer/chart/tests/test_doc_builder.py
test_extract_simple_route
TestExtractRoutesFromAppTsx
119
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_chart.py
test_chart_json_roundtrip_plotly
TestChartFormats
315
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer import SemanticModel from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestXorqIntegration: def test_metadata_preservation(self): """Test that BSL metadata is preserved through xorq tag...
dims
assert
variable
src/boring_semantic_layer/tests/test_xorq_integration.py
test_metadata_preservation
TestXorqIntegration
150
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_all_of_multilayer_calc_measure(): """t.all() should work when pointing at a calculated measure chain.""" con = ibis.duckdb.connect(":memory:") flights = pd.DataFrame( { "carrier":...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_measure_reference_styles.py
test_all_of_multilayer_calc_measure
261
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
"json"
assert
string_literal
src/boring_semantic_layer/agents/tests/test_tools.py
test_query_model_chart_format_param
TestQueryModelExplicitParams
536
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table def test_deferred_in_filter(): """Test using deferred expressions in filter().""" con = ibis.duckdb.connect(":memory:") flights = pd.DataFrame({"carrier": ["AA", "AA", "UA"], "distance": [1...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_deferred_api.py
test_deferred_in_filter
71
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def airports_table(con): """Create airports test data.""" airports_df = pd.DataFrame( { "code"...
6
assert
numeric_literal
src/boring_semantic_layer/tests/test_index.py
test_index_weights_are_counts
TestBasicIndex
165
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
data
assert
variable
src/boring_semantic_layer/tests/test_semantic_mcp.py
test_query_with_prefixed_fields_on_standalone_model
TestQueryModel
243
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestNestedSubtotals: def test_nested_subtotals_with_category_hierarchy(self): """Test category → subcategory → product hierarchy.""" con = ibis.duckdb.connect(":memory:") ...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_malloy_inspired.py
test_nested_subtotals_with_category_hierarchy
TestNestedSubtotals
298
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch class TestDisplayToolCall: def test_display_query_model_multiline(self): """Test displaying a multiline query_model call.""" from boring_semantic_layer.agents.chats.cli import display_tool_call with patch("boring_semantic_layer.agents.chats.cli.consol...
3
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_chats_cli.py
test_display_query_model_multiline
TestDisplayToolCall
30
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
None
assert
none_literal
src/boring_semantic_layer/agents/tests/test_semantic_mcp.py
test_simple_query
TestQueryModel
221
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def ecommerce_tables(con): """Create a realistic e-commerce schema with multiple tables.""" # Orders table ord...
joined._dims
assert
complex_expr
src/boring_semantic_layer/tests/test_join_prefixing.py
test_dimension_prefixing_on_join
TestDimensionPrefixing
504
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestFanOutTrap: def models(self): con = ibis.duckdb.connect(":memory:") orders_tbl = con.create_table( "orders", pd.DataFrame( { ...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_bi_traps.py
test_fanout_count_vs_nunique
TestFanOutTrap
126
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestFilterPushdown: def models(self): con = ibis.duckdb.connect(":memory:") customers_tbl = con.create_table( "customers", pd.DataFrame( ...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_bi_traps.py
test_filter_with_chasm
TestFilterPushdown
972
null
boringdata/boring-semantic-layer
import tempfile from pathlib import Path from boring_semantic_layer.chart.md_parser import MarkdownParser class TestMarkdownParser: def test_resolve_file_includes(self): """Test file inclusion resolution.""" with tempfile.TemporaryDirectory() as tmpdir: tmp_path = Path(tmpdir) ...
files
assert
variable
src/boring_semantic_layer/chart/tests/test_md_parser.py
test_resolve_file_includes
TestMarkdownParser
95
null
boringdata/boring-semantic-layer
import ibis from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.graph_utils import ( graph_bfs, graph_invert, graph_predecessors, graph_successors, graph_to_dict, ) def test_predecessors_successors_nonexistent(): """Test predecessors/successors for non-existent n...
set()
assert
func_call
src/boring_semantic_layer/tests/test_dependency_graph.py
test_predecessors_successors_nonexistent
575
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
None
assert
none_literal
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_parse_size_from_info
TestMarkdownParser
123
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def ecommerce_tables(con): """Create a realistic e-commerce schema with multiple tables.""" # Orders table ord...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_join_prefixing.py
test_deeply_nested_chained_joins
TestChainedJoinsProjection
906
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_mixed_reference_styles(): """Test mixing different reference styles in the same expression.""" con = ibis.duckdb.connect(":memory:") flights = pd.DataFrame({"carrier": ["AA", "AA", "UA"], "distance":...
p1)
pytest.approx
variable
src/boring_semantic_layer/tests/test_measure_reference_styles.py
test_mixed_reference_styles
170
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_double_level_nested_count(): """Test automatic unnesting with double-nested arrays (t.hits.product.count()).""" con = ibis.duckdb.connect(":memory:") data = pd.DataFrame( { "sess...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_nested_access.py
test_double_level_nested_count
60
null
boringdata/boring-semantic-layer
import ibis import pytest from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.query import Filter, query class TestFilterValueConversion: def test_none_passthrough(self): """Test that None passes through unchanged.""" f = Filter(filter={"field": "x", "operator": "="...
None
assert
none_literal
src/boring_semantic_layer/tests/test_date_filter_fix.py
test_none_passthrough
TestFilterValueConversion
291
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_valid_dimension_renamed(): """Test that dimensions can be renamed (dimension name != column name).""" con = ibis.duckdb.connect(":memory:") tbl = con.create_table("test", {"destination": ["NYC", "LAX...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_dimension_validation.py
test_valid_dimension_renamed
151
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
schema
assert
variable
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_schema_structure_compatible_with_azure_openai
TestSchemaGeneration
254
null
boringdata/boring-semantic-layer
import ibis from boring_semantic_layer import entity_dimension, time_dimension, to_semantic_table def test_entity_dimension_basic(): """Test that entity_dimension creates a dimension with is_entity=True.""" con = ibis.duckdb.connect(":memory:") data = ibis.memtable({"business_id": [1, 2, 3], "value": [100...
True
assert
bool_literal
src/boring_semantic_layer/tests/test_dimension_helpers.py
test_entity_dimension_basic
23
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from boring_semantic_layer.xorq_convert import from_tagged, to_tagged, try_import_xorq class TestMalloyXorqFeatures: def test_xorq_multi_engine_with_malloy_model(self): """Test that xorq expressions preserve BSL metadata across engines.""" import ...
dims
assert
variable
src/boring_semantic_layer/tests/test_malloy_xorq_roundtrip.py
test_xorq_multi_engine_with_malloy_model
TestMalloyXorqFeatures
460
null
boringdata/boring-semantic-layer
import json import ibis import pandas as pd import pytest from fastmcp import Client from fastmcp.exceptions import ToolError from boring_semantic_layer import MCPSemanticModel, to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def sample_models(con):...
{}
assert
collection
src/boring_semantic_layer/agents/tests/test_semantic_mcp.py
test_init_empty_models
TestMCPSemanticModelInitialization
100
null
boringdata/boring-semantic-layer
import json from unittest.mock import Mock, patch import pandas as pd import pytest from boring_semantic_layer.agents.utils.chart_handler import generate_chart_with_data def mock_query_result(): """Create a mock query result with execute() method.""" mock_result = Mock() df = pd.DataFrame({"origin": ["AT...
0
assert
numeric_literal
src/boring_semantic_layer/agents/tests/test_chart_handler.py
test_cli_mode_allows_plotext_backend
588
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestTopNWithNesting: def test_top_n_products_per_category(self): """Get top 3 products per category by revenue.""" con = ibis.duckdb.connect(":memory:") products_df ...
6
assert
numeric_literal
src/boring_semantic_layer/tests/test_malloy_inspired.py
test_top_n_products_per_category
TestTopNWithNesting
629
null
boringdata/boring-semantic-layer
import ibis import json import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.Data...
chart
assert
variable
src/boring_semantic_layer/chart/tests/test_echarts.py
test_basic_bar_chart
TestEChartsBasicCharts
77
null
boringdata/boring-semantic-layer
import ibis from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.graph_utils import ( graph_bfs, graph_invert, graph_predecessors, graph_successors, graph_to_dict, ) def test_empty_semantic_table(): """Test graph for a semantic table with no dimensions or measures...
{}
assert
collection
src/boring_semantic_layer/tests/test_dependency_graph.py
test_empty_semantic_table
256
null
boringdata/boring-semantic-layer
import json from pathlib import Path from unittest.mock import Mock, patch import pytest from returns.result import Failure, Success def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"carrier", "origin", "destination"} mock_model.measures = {"flight_count", "a...
[]
assert
collection
src/boring_semantic_layer/agents/tests/test_tools.py
test_list_models_tool_definition
TestToolDefinitions
44
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestSessionization: def test_session_metrics_with_duration(self): """Calculate session-level metrics including duration.""" con = ibis.duckdb.connect(":memory:") eve...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_malloy_inspired.py
test_session_metrics_with_duration
TestSessionization
181
null
boringdata/boring-semantic-layer
import re import subprocess from argparse import Namespace from pathlib import Path import pytest from boring_semantic_layer.agents.cli import ( TOOL_CONFIGS, _discover_skills_for_tool, _get_skills_dir, cmd_skill_install, cmd_skill_list, cmd_skill_show, ) class TestDiscoverSkillsForTool: ...
[]
assert
collection
src/boring_semantic_layer/agents/tests/test_cli_skill.py
test_returns_empty_for_unknown_tool
TestDiscoverSkillsForTool
47
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def ecommerce_tables(con): """Create a realistic e-commerce schema with multiple tables.""" # Orders table ord...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_join_prefixing.py
test_conflicting_measure_names_both_accessible
TestBasicPrefixing
106
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
None
assert
none_literal
src/boring_semantic_layer/chart/tests/test_chart.py
test_basic_bar_chart
TestAltairChart
62
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_single_level_nested_count(): """Test automatic unnesting with single-level array (t.hits.count()).""" con = ibis.duckdb.connect(":memory:") data = pd.DataFrame( { "session_id": [...
4
assert
numeric_literal
src/boring_semantic_layer/tests/test_nested_access.py
test_single_level_nested_count
32
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def airports_table(con): """Create airports test data.""" airports_df = pd.DataFrame( { "code"...
0
assert
numeric_literal
src/boring_semantic_layer/tests/test_index.py
test_index_all_dimensions
TestBasicIndex
107
null
boringdata/boring-semantic-layer
import ibis import pytest from ibis.expr.operations.relations import Aggregate from boring_semantic_layer.expr import SemanticModel from boring_semantic_layer.graph_utils import ( bfs, find_dimensions_and_measures, find_entity_dimensions, find_event_timestamp_dimensions, gen_children_of, replac...
str(expr)
assert
func_call
src/boring_semantic_layer/tests/test_graph_utils.py
test_replace_nodes_identity_replacer_leaves_expr_unchanged
55
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table class TestFanOutTrap: def models(self): con = ibis.duckdb.connect(":memory:") orders_tbl = con.create_table( "orders", pd.DataFrame( { ...
6
assert
numeric_literal
src/boring_semantic_layer/tests/test_bi_traps.py
test_fanout_leaf_measure_unaffected
TestFanOutTrap
109
null
boringdata/boring-semantic-layer
import pytest import pandas as pd from boring_semantic_layer.chart.echarts import ( EChartsBackend, EChartsChartType, EChartsOption, DEFAULT_COLOR_PALETTE, ) class TestEChartsBackend: def backend(self): """Create an EChartsBackend instance.""" return EChartsBackend() def samp...
[42]
assert
collection
src/boring_semantic_layer/chart/tests/test_echarts_backend.py
test_single_row_data
TestEChartsBackend
493
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
1
assert
numeric_literal
src/boring_semantic_layer/tests/test_chart.py
test_equality_operators_equivalence
TestFilterOperators
510
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_unnest_with_filter(): """Test filtering after unnesting.""" con = ibis.duckdb.connect(":memory:") data = pd.DataFrame( { "id": [1, 2], "values": [[10, 20, 30], [5, 15...
[20, 30]
assert
collection
src/boring_semantic_layer/tests/test_unnest.py
test_unnest_with_filter
119
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def ecommerce_tables(con): """Create a realistic e-commerce schema with multiple tables.""" # Orders table ord...
result.columns
assert
complex_expr
src/boring_semantic_layer/tests/test_join_prefixing.py
test_conflicting_measure_names_both_accessible
TestBasicPrefixing
100
null
boringdata/boring-semantic-layer
from __future__ import annotations import pytest from returns.result import Failure, Success from boring_semantic_layer.utils import expr_to_ibis_string, ibis_string_to_expr from boring_semantic_layer.xorq_convert import ( from_tagged, serialize_dimensions, serialize_measures, to_tagged, try_impor...
["tags"]
assert
collection
src/boring_semantic_layer/tests/test_xorq_convert.py
test_serialize_measures_with_metadata
150
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
None
assert
none_literal
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_none_values_work
TestJSONStringParsing
96
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def airports_table(con): """Create airports test data.""" airports_df = pd.DataFrame( { "code"...
3
assert
numeric_literal
src/boring_semantic_layer/tests/test_index.py
test_index_then_limit
TestIndexResultOperations
304
null
boringdata/boring-semantic-layer
from pathlib import Path from unittest.mock import patch from boring_semantic_layer.chart.md_parser.dashboard import ( _clean_label, _format_value, _generate_dashboard_html, _result_to_component, load_css_file, parse_frontmatter, BASE_CSS, DEFAULT_THEME_CSS, ) from boring_semantic_layer...
md
assert
variable
src/boring_semantic_layer/chart/md_parser/tests/test_dashboard.py
test_parse_frontmatter_empty
TestFrontmatterParsing
273
null
boringdata/boring-semantic-layer
import json from typing import Annotated, Any import ibis import pytest from pydantic import TypeAdapter, ValidationError from pydantic.functional_validators import BeforeValidator from boring_semantic_layer import MCPSemanticModel, to_semantic_table pytestmark = pytest.mark.anyio def anyio_backend(): return "a...
option
assert
variable
src/boring_semantic_layer/agents/tests/test_mcp_json_parsing.py
test_list_type_generates_better_schema_than_sequence
TestTypeHintImprovements
291
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
0
assert
numeric_literal
src/boring_semantic_layer/chart/tests/test_chart.py
test_chart_json_roundtrip_plotly
TestChartFormats
317
null
boringdata/boring-semantic-layer
import ibis import pytest from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.query import Filter, query class TestDateFilterConversion: def orders_table(self): """Create orders table with date column.""" con = ibis.duckdb.connect(":memory:") return con.crea...
2
assert
numeric_literal
src/boring_semantic_layer/tests/test_date_filter_fix.py
test_date_filter_in_operator
TestDateFilterConversion
115
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch import pytest pytest.importorskip("langchain", reason="langchain not installed") def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"category", "region"} mock_model.measures = {"count", "total"} mock_model.description ...
"prod"
assert
string_literal
src/boring_semantic_layer/agents/tests/test_langgraph_backend.py
test_init_with_profile
TestLangGraphBackendInit
89
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from ibis import _ from boring_semantic_layer import to_semantic_table def test_deferred_comprehensive_workflow(): """ Comprehensive test using deferred API in ALL applicable methods in a single workflow: - with_dimensions() ✓ - with_measures() ✓ - fil...
4
assert
numeric_literal
src/boring_semantic_layer/tests/test_deferred_api.py
test_deferred_comprehensive_workflow
347
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch import pytest pytest.importorskip("langchain", reason="langchain not installed") def mock_models(): """Mock semantic models.""" mock_model = Mock() mock_model.dimensions = {"category", "region"} mock_model.measures = {"count", "total"} mock_model.description ...
[]
assert
collection
src/boring_semantic_layer/agents/tests/test_langgraph_backend.py
test_init_empty_history
TestLangGraphBackendInit
109
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
None
assert
none_literal
src/boring_semantic_layer/chart/tests/test_backends.py
test_bar_chart_categorical
TestPlotextChartTypes
207
null
boringdata/boring-semantic-layer
import ibis import pytest from ibis.expr.operations.relations import Aggregate from boring_semantic_layer.expr import SemanticModel from boring_semantic_layer.graph_utils import ( bfs, find_dimensions_and_measures, find_entity_dimensions, find_event_timestamp_dimensions, gen_children_of, replac...
graph
assert
variable
src/boring_semantic_layer/tests/test_graph_utils.py
test_bfs_and_gen_children_of_simple_expr
27
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def con(): """DuckDB connection for all tests.""" return ibis.duckdb.connect(":memory:") def flights_model(con): """Create a sample flights semantic table for testing.""" flights_df = pd.DataFrame( ...
2
assert
numeric_literal
src/boring_semantic_layer/chart/tests/test_backends.py
test_grouped_bar_multiple_measures
TestPlotlyChartTypes
159
null
boringdata/boring-semantic-layer
import ibis import pandas as pd import pytest from boring_semantic_layer import to_semantic_table def test_unnest_preserves_other_columns(): """Test that unnesting preserves other columns correctly.""" con = ibis.duckdb.connect(":memory:") data = pd.DataFrame( { "session_id": [1, 2], ...
"Alice"
assert
string_literal
src/boring_semantic_layer/tests/test_unnest.py
test_unnest_preserves_other_columns
142
null
boringdata/boring-semantic-layer
import ibis import pytest from boring_semantic_layer.api import to_semantic_table from boring_semantic_layer.query import Filter, query class TestSQLGeneration: def test_trino_sql_generation(self): """Test that Trino/Athena SQL uses proper date functions.""" con = ibis.duckdb.connect(":memory:") ...
sql
assert
variable
src/boring_semantic_layer/tests/test_date_filter_fix.py
test_trino_sql_generation
TestSQLGeneration
238
null
boringdata/boring-semantic-layer
from unittest.mock import Mock, patch class TestDisplayError: def test_display_error_prints_red(self): """Test that errors are displayed in red.""" from boring_semantic_layer.agents.chats.cli import display_error with patch("boring_semantic_layer.agents.chats.cli.console") as mock_console...
"red"
assert
string_literal
src/boring_semantic_layer/agents/tests/test_chats_cli.py
test_display_error_prints_red
TestDisplayError
101
null
boringdata/boring-semantic-layer
class TestLoadPrompt: def test_load_with_unicode(self, tmp_path): """Test loading a file with unicode characters.""" from boring_semantic_layer.agents.utils.prompts import load_prompt test_file = tmp_path / "unicode.md" test_file.write_text("# Test\n\nUnicode: \u2713 \u2717 \U0001f...
result
assert
variable
src/boring_semantic_layer/agents/tests/test_prompts.py
test_load_with_unicode
TestLoadPrompt
69
null
boringdata/boring-semantic-layer
from boring_semantic_layer.chart.md_parser import QueryExecutor class TestQueryExecutor: def test_multiline_statement(self): """Test execution of multiline statements.""" executor = QueryExecutor() code = """ def add(a, b): return a + b result = add(5, 3) """ executor.execute(...
8
assert
numeric_literal
src/boring_semantic_layer/chart/tests/test_md_executor.py
test_multiline_statement
TestQueryExecutor
87
null