Skip to content

Commit

Permalink
Release 1.2.0 (#296)
Browse files Browse the repository at this point in the history
* Bump version to 1.2.0

* Add failing repeat test

* Use temporary view to avoid crash
  • Loading branch information
jonmmease authored Apr 12, 2023
1 parent 3b7925e commit c403f10
Show file tree
Hide file tree
Showing 22 changed files with 89 additions and 63 deletions.
18 changes: 9 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/vegafusion-embed/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion javascript/vegafusion-embed/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vegafusion-embed",
"version": "1.1.3",
"version": "1.2.0",
"description": "Library to embed vegafusion visualizations",
"keywords": [
"vega",
Expand Down
2 changes: 1 addition & 1 deletion python/vegafusion-jupyter/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion python/vegafusion-jupyter/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vegafusion-jupyter",
"version": "1.1.3",
"version": "1.2.0",
"description": "Altair Jupyter Widget library that relies on VegaFusion for serverside calculations",
"keywords": [
"jupyter",
Expand Down
2 changes: 1 addition & 1 deletion python/vegafusion-jupyter/vegafusion_jupyter/_frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Information about the frontend package of the widgets.
"""
module_name = "vegafusion-jupyter"
module_version = "^1.1.3"
module_version = "^1.2.0"
2 changes: 1 addition & 1 deletion python/vegafusion-jupyter/vegafusion_jupyter/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.3'
__version__ = '1.2.0'
4 changes: 2 additions & 2 deletions python/vegafusion/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ universal = 0
[metadata]
name = vegafusion
description = Core tools for using VegaFusion from Python
version = 1.1.3
version = 1.2.0
long_description = file: README.md
long_description_content_type = text/markdown
keywords = vega, altair, vegafusion, arrow
Expand Down Expand Up @@ -34,6 +34,6 @@ install_requires =

[options.extras_require]
embed =
vegafusion-python-embed==1.1.3
vegafusion-python-embed==1.2.0
vl-convert-python>=0.7.0

28 changes: 22 additions & 6 deletions python/vegafusion/tests/test_pretransform.py
Original file line number Diff line number Diff line change
Expand Up @@ -1108,13 +1108,33 @@ def test_duckdb_timestamp_with_timezone():
finally:
vf.runtime.set_connection("datafusion")


def test_gh_268_hang():
"""
Tests for hang reported in https://github.com/hex-inc/vegafusion/issues/268
"""
vf.runtime.set_connection("datafusion")
movies = pd.read_json("https://raw.githubusercontent.com/vega/vega-datasets/main/data/movies.json")
spec = gh_268_hang_spec()
for i in range(20):
# Break cache by removing one row each iteration
movies_inner = movies.iloc[i:]
vf.runtime.pre_transform_datasets(spec, ["data_3"], "UTC", inline_datasets=dict(movies_clean=movies_inner))


def test_repeat_duckdb():
"""
Tests for hang reported in https://github.com/hex-inc/vegafusion/issues/268
"""
vf.runtime.set_connection("duckdb")
movies = pd.read_json("https://raw.githubusercontent.com/vega/vega-datasets/main/data/movies.json")
spec = json.loads(r"""
spec = gh_268_hang_spec()
for i in range(2):
vf.runtime.pre_transform_datasets(spec, ["data_3"], "UTC", inline_datasets=dict(movies_clean=movies))


def gh_268_hang_spec():
return json.loads(r"""
{
"$schema": "https://vega.github.io/schema/vega/v5.json",
"data": [
Expand Down Expand Up @@ -1179,8 +1199,4 @@ def test_gh_268_hang():
}
]
}
""")
for i in range(20):
# Break cache by removing one row each iteration
movies_inner = movies.iloc[i:]
vf.runtime.pre_transform_datasets(spec, ["data_3"], "UTC", inline_datasets=dict(movies_clean=movies_inner))
""")
2 changes: 1 addition & 1 deletion python/vegafusion/vegafusion/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '1.1.3'
__version__ = '1.2.0'
20 changes: 15 additions & 5 deletions python/vegafusion/vegafusion/connection/duckdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import pyarrow as pa
import pandas as pd
import logging

import uuid

# Table suffix name to use for raw registered table
RAW_PREFIX = "_vf_raw_"
Expand Down Expand Up @@ -223,10 +223,20 @@ def fetch_query(self, query: str, schema: pa.Schema) -> pa.Table:
self.logger.info(f"Query:\n{query}\n")
if self._verbose:
print(f"DuckDB Query:\n{query}\n")
rel = self.conn.query(query)
tmp_table = "_duckdb_tmp_tbl"
replace_query = pyarrow_schema_to_select_replace(schema, tmp_table)
return rel.query(tmp_table, replace_query).to_arrow_table(8096)

# Save query result to temporary view
tmp_table = "_duckdb_tmp_tbl" + str(uuid.uuid4()).replace("-", "_")
self.conn.query(query).to_view(tmp_table)

try:
# Run replacement query to cast types to match schema
replace_query = pyarrow_schema_to_select_replace(schema, tmp_table)
result = self.conn.query(replace_query).to_arrow_table(8096)
finally:
# Unregister temporary view
self.conn.unregister(tmp_table)

return result

def _update_temp_names(self, name: str, temporary: bool):
if temporary:
Expand Down
2 changes: 1 addition & 1 deletion vegafusion-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "vegafusion-common"
version = "1.1.3"
version = "1.2.0"
edition = "2021"
description = "Common components required by multiple VegaFusion crates"
license = "BSD-3-Clause"
Expand Down
4 changes: 2 additions & 2 deletions vegafusion-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "vegafusion-core"
license = "BSD-3-Clause"
edition = "2021"
version = "1.1.3"
version = "1.2.0"
description = "Core components required by multiple VegaFusion crates, with WASM compatibility"

[features]
Expand Down Expand Up @@ -35,7 +35,7 @@ features = [ "preserve_order",]
[dependencies.vegafusion-common]
path = "../vegafusion-common"
features = [ "json", "sqlparser",]
version = "1.1.3"
version = "1.2.0"

[dependencies.datafusion-common]
version = "22.0.0"
Expand Down
4 changes: 2 additions & 2 deletions vegafusion-dataframe/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "vegafusion-dataframe"
license = "BSD-3-Clause"
version = "1.1.3"
version = "1.2.0"
edition = "2021"
description = "VegaFusion's DataFrame and Connection traits"

Expand All @@ -10,7 +10,7 @@ async-trait = "0.1.53"

[dependencies.vegafusion-common]
path = "../vegafusion-common"
version = "1.1.3"
version = "1.2.0"

[dependencies.datafusion-common]
version = "22.0.0"
Expand Down
4 changes: 2 additions & 2 deletions vegafusion-datafusion-udfs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "vegafusion-datafusion-udfs"
license = "BSD-3-Clause"
version = "1.1.3"
version = "1.2.0"
edition = "2021"
description = "Custom DataFusion UDFs used by VegaFusion"

Expand All @@ -14,7 +14,7 @@ regex = "^1.5.5"

[dependencies.vegafusion-common]
path = "../vegafusion-common"
version = "1.1.3"
version = "1.2.0"

[dependencies.datafusion-physical-expr]
version = "22.0.0"
10 changes: 5 additions & 5 deletions vegafusion-python-embed/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "vegafusion-python-embed"
license = "BSD-3-Clause"
edition = "2021"
version = "1.1.3"
version = "1.2.0"
description = "vegafusion-python-embed PyO3 Python Package"

[lib]
Expand Down Expand Up @@ -36,21 +36,21 @@ features = [ "pyarrow",]
[dependencies.vegafusion-common]
path = "../vegafusion-common"
features = [ "pyo3",]
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-core]
path = "../vegafusion-core"
features = [ "pyarrow",]
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-runtime]
path = "../vegafusion-runtime"
features = [ "pyarrow",]
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-sql]
path = "../vegafusion-sql"
version = "1.1.3"
version = "1.2.0"
features = [ "datafusion-conn",]

[dependencies.tokio]
Expand Down
12 changes: 6 additions & 6 deletions vegafusion-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ harness = false
name = "vegafusion-runtime"
license = "BSD-3-Clause"
edition = "2021"
version = "1.1.3"
version = "1.2.0"
description = "VegaFusion Runtime"

[features]
Expand Down Expand Up @@ -59,20 +59,20 @@ version = "0.32.0"
[dependencies.vegafusion-common]
path = "../vegafusion-common"
features = [ "json", "sqlparser", "prettyprint",]
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-core]
path = "../vegafusion-core"
features = [ "sqlparser",]
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-datafusion-udfs]
path = "../vegafusion-datafusion-udfs"
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-dataframe]
path = "../vegafusion-dataframe"
version = "1.1.3"
version = "1.2.0"

[dependencies.serde]
version = "1.0.137"
Expand Down Expand Up @@ -110,5 +110,5 @@ features = [ "async_tokio",]

[dev-dependencies.vegafusion-sql]
path = "../vegafusion-sql"
version = "1.1.3"
version = "1.2.0"
features = [ "datafusion-conn",]
10 changes: 5 additions & 5 deletions vegafusion-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ path = "src/main.rs"
[package]
name = "vegafusion-server"
license = "BSD-3-Clause"
version = "1.1.3"
version = "1.2.0"
edition = "2021"
description = "VegaFusion Server"

Expand All @@ -29,20 +29,20 @@ prost-build = "0.11.4"

[dependencies.vegafusion-common]
path = "../vegafusion-common"
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-core]
path = "../vegafusion-core"
features = [ "tonic_support",]
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-runtime]
path = "../vegafusion-runtime"
version = "1.1.3"
version = "1.2.0"

[dependencies.vegafusion-sql]
path = "../vegafusion-sql"
version = "1.1.3"
version = "1.2.0"
features = [ "datafusion-conn",]

[dependencies.tokio]
Expand Down
Loading

0 comments on commit c403f10

Please sign in to comment.