MCPcopy Create free account
hub / github.com/python-visualization/folium / vegalite_spec

Function vegalite_spec

tests/test_features.py:123–140  ·  view source on GitHub ↗
(version)

Source from the content-addressed store, hash-verified

121
122@pytest.fixture
123def vegalite_spec(version):
124 file_version = "v1" if version == 1 else "vlater"
125 file = os.path.join(rootpath, "vegalite_data", f"vegalite_{file_version}.json")
126
127 if not os.path.exists(file):
128 raise FileNotFoundError(f"The vegalite data {file} does not exist.")
129
130 with open(file) as f:
131 spec = json.load(f)
132
133 if version is None or "$schema" in spec:
134 return spec
135
136 # Sample versions that might show up
137 schema_version = {2: "v2.6.0", 3: "v3.6.0", 4: "v4.6.0", 5: "v5.1.0"}[version]
138 spec["$schema"] = f"https://vega.github.io/schema/vega-lite/{schema_version}.json"
139
140 return spec
141
142
143@pytest.mark.parametrize("version", [1, 2, 3, 4, 5, None])

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…