itables 2.1.2__tar.gz → 2.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {itables-2.1.2 → itables-2.1.4}/PKG-INFO +1 -1
- {itables-2.1.2 → itables-2.1.4}/docs/changelog.md +15 -1
- {itables-2.1.2 → itables-2.1.4}/src/itables/datatables_format.py +16 -5
- {itables-2.1.2 → itables-2.1.4}/src/itables/sample_dfs.py +3 -3
- {itables-2.1.2 → itables-2.1.4}/src/itables/version.py +1 -1
- {itables-2.1.2 → itables-2.1.4}/tests/test_datatables_format.py +16 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_polars.py +17 -0
- {itables-2.1.2 → itables-2.1.4}/.github/codecov.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/.github/workflows/comment-pr.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/.github/workflows/continuous-integration.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/.github/workflows/publish-book.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/.github/workflows/publish.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/.gitignore +0 -0
- {itables-2.1.2 → itables-2.1.4}/.pre-commit-config.yaml +0 -0
- {itables-2.1.2 → itables-2.1.4}/.pylintrc +0 -0
- {itables-2.1.2 → itables-2.1.4}/LICENSE +0 -0
- {itables-2.1.2 → itables-2.1.4}/README.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/binder/labconfig/default_setting_overrides.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/binder/postBuild +0 -0
- {itables-2.1.2 → itables-2.1.4}/binder/requirements.txt +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/_config.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/_toc.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/advanced_parameters.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/contributing.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/custom_css.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/custom_extensions.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/dash.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/developing.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/df_example.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/downsampling.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/extensions.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/formatting.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/html_export.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/images/code.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/images/colab.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/images/html.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/images/lab.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/images/notebook.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/images/pycharm.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/ipywidgets.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/pandas_style.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/polars_dataframes.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/quarto/quarto_html.qmd +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/quarto/quarto_revealjs.qmd +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/quarto.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/quick_start.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/references.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/sample_dataframes.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/shiny.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/show_df.png +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/streamlit.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/supported_editors.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/docs/troubleshooting.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/environment.yml +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/CHANGELOG.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/LICENSE +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/README.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/package-lock.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/package.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/src/index.css +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/src/index.d.ts +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/dt_for_itables/src/index.js +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/itables_for_streamlit/README.md +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/itables_for_streamlit/package-lock.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/itables_for_streamlit/package.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/itables_for_streamlit/public/index.html +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/itables_for_streamlit/src/index.tsx +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/itables_for_streamlit/tsconfig.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/package-lock.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/packages/package.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/pyproject.toml +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/__init__.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/downsample.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/html/column_filters/initComplete.js +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/html/column_filters/pre_dt_code.js +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/html/datatables_template.html +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/html/dt_bundle.css +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/html/dt_bundle.js +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/html/init_datatables.html +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/interactive.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/asset-manifest.json +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/index.html +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/css/main.8eddd46d.css +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/css/main.8eddd46d.css.map +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js.LICENSE.txt +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js.map +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/javascript.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/logo/loading.svg +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/logo/logo.svg +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/logo/text.svg +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/logo/wide.svg +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/logo/with_text.svg +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/options.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/samples/countries.csv +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/samples/indicators.csv +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/samples/population.csv +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/shiny.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/streamlit.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/src/itables/utils.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/__init__.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/conftest.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/sample_python_apps/itables_in_a_shiny_app.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/sample_python_apps/itables_in_a_shiny_app_with_tabs.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_changelog.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_connected_notebook_is_small.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_documentation_notebooks_run.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_downsample.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_extension_arguments.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_html_in_table_header.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_init.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_javascript.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_json_dumps.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_notebook.ipynb +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_pandas_style.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_sample_dfs.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_sample_python_apps.py +0 -0
- {itables-2.1.2 → itables-2.1.4}/tests/test_update_samples.py +0 -0
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
ITables ChangeLog
|
|
2
2
|
=================
|
|
3
3
|
|
|
4
|
+
2.1.4 (2024-07-03)
|
|
5
|
+
------------------
|
|
6
|
+
|
|
7
|
+
**Fixed**
|
|
8
|
+
- We have fixed an OverflowError (_can't convert negative int to unsigned_) when displaying Polars DataFrames that contain unsigned integers ([#299](https://github.com/mwouts/itables/issues/299))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
2.1.3 (2024-06-22)
|
|
12
|
+
------------------
|
|
13
|
+
|
|
14
|
+
**Fixed**
|
|
15
|
+
- We have improved the detection of large integers in the context of Polars DataFrames ([#291](https://github.com/mwouts/itables/issues/291))
|
|
16
|
+
|
|
17
|
+
|
|
4
18
|
2.1.2 (2024-06-19)
|
|
5
19
|
------------------
|
|
6
20
|
|
|
@@ -9,7 +23,7 @@ ITables ChangeLog
|
|
|
9
23
|
an automatic horizontal scrolling in Jupyter, Jupyter Book and also Streamlit if the table is too wide ([#282](https://github.com/mwouts/itables/pull/282)).
|
|
10
24
|
|
|
11
25
|
**Fixed**
|
|
12
|
-
- The dependencies of the streamlit components have been updated to fix a vulnerability in `ws` ([Alert
|
|
26
|
+
- The dependencies of the streamlit components have been updated to fix a vulnerability in `ws` ([Alert 1](https://github.com/mwouts/itables/security/dependabot/1))
|
|
13
27
|
|
|
14
28
|
|
|
15
29
|
2.1.1 (2024-06-08)
|
|
@@ -114,8 +114,11 @@ def datatables_rows(df, count=None, warn_on_unexpected_types=False, pure_json=Fa
|
|
|
114
114
|
import polars as pl
|
|
115
115
|
|
|
116
116
|
has_bigints = any(
|
|
117
|
-
|
|
118
|
-
|
|
117
|
+
(
|
|
118
|
+
x.dtype == pl.Int64
|
|
119
|
+
and ((x > JS_MAX_SAFE_INTEGER).any() or (x < JS_MIN_SAFE_INTEGER).any())
|
|
120
|
+
)
|
|
121
|
+
or (x.dtype == pl.UInt64 and (x > JS_MAX_SAFE_INTEGER).any())
|
|
119
122
|
for x in (df[col] for col in df.columns)
|
|
120
123
|
)
|
|
121
124
|
js = json.dumps(data, cls=generate_encoder(False), allow_nan=not pure_json)
|
|
@@ -129,7 +132,15 @@ def datatables_rows(df, count=None, warn_on_unexpected_types=False, pure_json=Fa
|
|
|
129
132
|
def n_suffix_for_bigints(js, pure_json=False):
|
|
130
133
|
def n_suffix(matchobj):
|
|
131
134
|
if pure_json:
|
|
132
|
-
return '"' + matchobj.group(
|
|
133
|
-
return
|
|
135
|
+
return matchobj.group(1) + '"' + matchobj.group(2) + '"' + matchobj.group(3)
|
|
136
|
+
return (
|
|
137
|
+
matchobj.group(1)
|
|
138
|
+
+ 'BigInt("'
|
|
139
|
+
+ matchobj.group(2)
|
|
140
|
+
+ '")'
|
|
141
|
+
+ matchobj.group(3)
|
|
142
|
+
)
|
|
134
143
|
|
|
135
|
-
|
|
144
|
+
big_int_re = re.compile(r"^([\[\s]+)(-?\d{16,})(\]*)$")
|
|
145
|
+
parts = js.split(",")
|
|
146
|
+
return ",".join(re.sub(big_int_re, n_suffix, part) for part in parts)
|
|
@@ -301,9 +301,9 @@ def get_dict_of_test_series(polars=False):
|
|
|
301
301
|
|
|
302
302
|
# Add a Polar table with unsigned integers
|
|
303
303
|
# https://github.com/mwouts/itables/issues/192
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
)
|
|
304
|
+
# https://github.com/mwouts/itables/issues/299
|
|
305
|
+
polars_series["u32"] = pl.Series([1, 2, 5]).cast(pl.UInt32)
|
|
306
|
+
polars_series["u64"] = pl.Series([1, 2, 2**40]).cast(pl.UInt64)
|
|
307
307
|
|
|
308
308
|
return polars_series
|
|
309
309
|
|
|
@@ -154,3 +154,19 @@ def test_encode_max_int(large):
|
|
|
154
154
|
def test_encode_not_max_int(large):
|
|
155
155
|
large //= 10
|
|
156
156
|
assert n_suffix_for_bigints(json.dumps([large])) == "[{}]".format(large)
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
def test_encode_mixed_contents():
|
|
160
|
+
# Make sure that the bigint escape works for mixed content # 291
|
|
161
|
+
df = pd.DataFrame(
|
|
162
|
+
{
|
|
163
|
+
"bigint": [1666767918216000000],
|
|
164
|
+
"int": [1699300000000],
|
|
165
|
+
"float": [0.9510565400123596],
|
|
166
|
+
"neg": [-0.30901700258255005],
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
assert (
|
|
170
|
+
datatables_rows(df)
|
|
171
|
+
== '[[BigInt("1666767918216000000"), 1699300000000, 0.951057, -0.309017]]'
|
|
172
|
+
)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import pytest
|
|
2
2
|
|
|
3
3
|
from itables import to_html_datatable
|
|
4
|
+
from itables.javascript import datatables_rows
|
|
4
5
|
from itables.sample_dfs import get_dict_of_test_dfs, get_dict_of_test_series
|
|
5
6
|
|
|
6
7
|
try:
|
|
@@ -21,3 +22,19 @@ def test_show_polars_series(name, x, use_to_html):
|
|
|
21
22
|
)
|
|
22
23
|
def test_show_polars_df(name, df, use_to_html):
|
|
23
24
|
to_html_datatable(df, use_to_html)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def test_encode_mixed_contents():
|
|
28
|
+
# Make sure that the bigint escape works for mixed content # 291
|
|
29
|
+
df = polars.DataFrame(
|
|
30
|
+
{
|
|
31
|
+
"bigint": [1666767918216000000],
|
|
32
|
+
"int": [1699300000000],
|
|
33
|
+
"float": [0.9510565400123596],
|
|
34
|
+
"neg": [-0.30901700258255005],
|
|
35
|
+
}
|
|
36
|
+
)
|
|
37
|
+
assert (
|
|
38
|
+
datatables_rows(df)
|
|
39
|
+
== '[[BigInt("1666767918216000000"), 1699300000000, 0.9510565400123596, -0.30901700258255005]]'
|
|
40
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/css/main.8eddd46d.css
RENAMED
|
File without changes
|
{itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/css/main.8eddd46d.css.map
RENAMED
|
File without changes
|
{itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js
RENAMED
|
File without changes
|
|
File without changes
|
{itables-2.1.2 → itables-2.1.4}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js.map
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{itables-2.1.2 → itables-2.1.4}/tests/sample_python_apps/itables_in_a_shiny_app_with_tabs.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|