itables 2.1.2__tar.gz → 2.1.3__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.
Files changed (118) hide show
  1. {itables-2.1.2 → itables-2.1.3}/PKG-INFO +1 -1
  2. {itables-2.1.2 → itables-2.1.3}/docs/changelog.md +8 -1
  3. {itables-2.1.2 → itables-2.1.3}/src/itables/datatables_format.py +11 -3
  4. {itables-2.1.2 → itables-2.1.3}/src/itables/version.py +1 -1
  5. {itables-2.1.2 → itables-2.1.3}/tests/test_datatables_format.py +16 -0
  6. {itables-2.1.2 → itables-2.1.3}/tests/test_polars.py +17 -0
  7. {itables-2.1.2 → itables-2.1.3}/.github/codecov.yml +0 -0
  8. {itables-2.1.2 → itables-2.1.3}/.github/workflows/comment-pr.yml +0 -0
  9. {itables-2.1.2 → itables-2.1.3}/.github/workflows/continuous-integration.yml +0 -0
  10. {itables-2.1.2 → itables-2.1.3}/.github/workflows/publish-book.yml +0 -0
  11. {itables-2.1.2 → itables-2.1.3}/.github/workflows/publish.yml +0 -0
  12. {itables-2.1.2 → itables-2.1.3}/.gitignore +0 -0
  13. {itables-2.1.2 → itables-2.1.3}/.pre-commit-config.yaml +0 -0
  14. {itables-2.1.2 → itables-2.1.3}/.pylintrc +0 -0
  15. {itables-2.1.2 → itables-2.1.3}/LICENSE +0 -0
  16. {itables-2.1.2 → itables-2.1.3}/README.md +0 -0
  17. {itables-2.1.2 → itables-2.1.3}/binder/labconfig/default_setting_overrides.json +0 -0
  18. {itables-2.1.2 → itables-2.1.3}/binder/postBuild +0 -0
  19. {itables-2.1.2 → itables-2.1.3}/binder/requirements.txt +0 -0
  20. {itables-2.1.2 → itables-2.1.3}/docs/_config.yml +0 -0
  21. {itables-2.1.2 → itables-2.1.3}/docs/_toc.yml +0 -0
  22. {itables-2.1.2 → itables-2.1.3}/docs/advanced_parameters.md +0 -0
  23. {itables-2.1.2 → itables-2.1.3}/docs/contributing.md +0 -0
  24. {itables-2.1.2 → itables-2.1.3}/docs/custom_css.md +0 -0
  25. {itables-2.1.2 → itables-2.1.3}/docs/custom_extensions.md +0 -0
  26. {itables-2.1.2 → itables-2.1.3}/docs/dash.md +0 -0
  27. {itables-2.1.2 → itables-2.1.3}/docs/developing.md +0 -0
  28. {itables-2.1.2 → itables-2.1.3}/docs/df_example.png +0 -0
  29. {itables-2.1.2 → itables-2.1.3}/docs/downsampling.md +0 -0
  30. {itables-2.1.2 → itables-2.1.3}/docs/extensions.md +0 -0
  31. {itables-2.1.2 → itables-2.1.3}/docs/formatting.md +0 -0
  32. {itables-2.1.2 → itables-2.1.3}/docs/html_export.md +0 -0
  33. {itables-2.1.2 → itables-2.1.3}/docs/images/code.png +0 -0
  34. {itables-2.1.2 → itables-2.1.3}/docs/images/colab.png +0 -0
  35. {itables-2.1.2 → itables-2.1.3}/docs/images/html.png +0 -0
  36. {itables-2.1.2 → itables-2.1.3}/docs/images/lab.png +0 -0
  37. {itables-2.1.2 → itables-2.1.3}/docs/images/notebook.png +0 -0
  38. {itables-2.1.2 → itables-2.1.3}/docs/images/pycharm.png +0 -0
  39. {itables-2.1.2 → itables-2.1.3}/docs/ipywidgets.md +0 -0
  40. {itables-2.1.2 → itables-2.1.3}/docs/pandas_style.md +0 -0
  41. {itables-2.1.2 → itables-2.1.3}/docs/polars_dataframes.md +0 -0
  42. {itables-2.1.2 → itables-2.1.3}/docs/quarto/quarto_html.qmd +0 -0
  43. {itables-2.1.2 → itables-2.1.3}/docs/quarto/quarto_revealjs.qmd +0 -0
  44. {itables-2.1.2 → itables-2.1.3}/docs/quarto.md +0 -0
  45. {itables-2.1.2 → itables-2.1.3}/docs/quick_start.md +0 -0
  46. {itables-2.1.2 → itables-2.1.3}/docs/references.md +0 -0
  47. {itables-2.1.2 → itables-2.1.3}/docs/sample_dataframes.md +0 -0
  48. {itables-2.1.2 → itables-2.1.3}/docs/shiny.md +0 -0
  49. {itables-2.1.2 → itables-2.1.3}/docs/show_df.png +0 -0
  50. {itables-2.1.2 → itables-2.1.3}/docs/streamlit.md +0 -0
  51. {itables-2.1.2 → itables-2.1.3}/docs/supported_editors.md +0 -0
  52. {itables-2.1.2 → itables-2.1.3}/docs/troubleshooting.md +0 -0
  53. {itables-2.1.2 → itables-2.1.3}/environment.yml +0 -0
  54. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/CHANGELOG.md +0 -0
  55. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/LICENSE +0 -0
  56. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/README.md +0 -0
  57. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/package-lock.json +0 -0
  58. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/package.json +0 -0
  59. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/src/index.css +0 -0
  60. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/src/index.d.ts +0 -0
  61. {itables-2.1.2 → itables-2.1.3}/packages/dt_for_itables/src/index.js +0 -0
  62. {itables-2.1.2 → itables-2.1.3}/packages/itables_for_streamlit/README.md +0 -0
  63. {itables-2.1.2 → itables-2.1.3}/packages/itables_for_streamlit/package-lock.json +0 -0
  64. {itables-2.1.2 → itables-2.1.3}/packages/itables_for_streamlit/package.json +0 -0
  65. {itables-2.1.2 → itables-2.1.3}/packages/itables_for_streamlit/public/index.html +0 -0
  66. {itables-2.1.2 → itables-2.1.3}/packages/itables_for_streamlit/src/index.tsx +0 -0
  67. {itables-2.1.2 → itables-2.1.3}/packages/itables_for_streamlit/tsconfig.json +0 -0
  68. {itables-2.1.2 → itables-2.1.3}/packages/package-lock.json +0 -0
  69. {itables-2.1.2 → itables-2.1.3}/packages/package.json +0 -0
  70. {itables-2.1.2 → itables-2.1.3}/pyproject.toml +0 -0
  71. {itables-2.1.2 → itables-2.1.3}/src/itables/__init__.py +0 -0
  72. {itables-2.1.2 → itables-2.1.3}/src/itables/downsample.py +0 -0
  73. {itables-2.1.2 → itables-2.1.3}/src/itables/html/column_filters/initComplete.js +0 -0
  74. {itables-2.1.2 → itables-2.1.3}/src/itables/html/column_filters/pre_dt_code.js +0 -0
  75. {itables-2.1.2 → itables-2.1.3}/src/itables/html/datatables_template.html +0 -0
  76. {itables-2.1.2 → itables-2.1.3}/src/itables/html/dt_bundle.css +0 -0
  77. {itables-2.1.2 → itables-2.1.3}/src/itables/html/dt_bundle.js +0 -0
  78. {itables-2.1.2 → itables-2.1.3}/src/itables/html/init_datatables.html +0 -0
  79. {itables-2.1.2 → itables-2.1.3}/src/itables/interactive.py +0 -0
  80. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/asset-manifest.json +0 -0
  81. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/index.html +0 -0
  82. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/static/css/main.8eddd46d.css +0 -0
  83. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/static/css/main.8eddd46d.css.map +0 -0
  84. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js +0 -0
  85. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js.LICENSE.txt +0 -0
  86. {itables-2.1.2 → itables-2.1.3}/src/itables/itables_for_streamlit/static/js/main.ffa367f6.js.map +0 -0
  87. {itables-2.1.2 → itables-2.1.3}/src/itables/javascript.py +0 -0
  88. {itables-2.1.2 → itables-2.1.3}/src/itables/logo/loading.svg +0 -0
  89. {itables-2.1.2 → itables-2.1.3}/src/itables/logo/logo.svg +0 -0
  90. {itables-2.1.2 → itables-2.1.3}/src/itables/logo/text.svg +0 -0
  91. {itables-2.1.2 → itables-2.1.3}/src/itables/logo/wide.svg +0 -0
  92. {itables-2.1.2 → itables-2.1.3}/src/itables/logo/with_text.svg +0 -0
  93. {itables-2.1.2 → itables-2.1.3}/src/itables/options.py +0 -0
  94. {itables-2.1.2 → itables-2.1.3}/src/itables/sample_dfs.py +0 -0
  95. {itables-2.1.2 → itables-2.1.3}/src/itables/samples/countries.csv +0 -0
  96. {itables-2.1.2 → itables-2.1.3}/src/itables/samples/indicators.csv +0 -0
  97. {itables-2.1.2 → itables-2.1.3}/src/itables/samples/population.csv +0 -0
  98. {itables-2.1.2 → itables-2.1.3}/src/itables/shiny.py +0 -0
  99. {itables-2.1.2 → itables-2.1.3}/src/itables/streamlit.py +0 -0
  100. {itables-2.1.2 → itables-2.1.3}/src/itables/utils.py +0 -0
  101. {itables-2.1.2 → itables-2.1.3}/tests/__init__.py +0 -0
  102. {itables-2.1.2 → itables-2.1.3}/tests/conftest.py +0 -0
  103. {itables-2.1.2 → itables-2.1.3}/tests/sample_python_apps/itables_in_a_shiny_app.py +0 -0
  104. {itables-2.1.2 → itables-2.1.3}/tests/sample_python_apps/itables_in_a_shiny_app_with_tabs.py +0 -0
  105. {itables-2.1.2 → itables-2.1.3}/tests/test_changelog.py +0 -0
  106. {itables-2.1.2 → itables-2.1.3}/tests/test_connected_notebook_is_small.py +0 -0
  107. {itables-2.1.2 → itables-2.1.3}/tests/test_documentation_notebooks_run.py +0 -0
  108. {itables-2.1.2 → itables-2.1.3}/tests/test_downsample.py +0 -0
  109. {itables-2.1.2 → itables-2.1.3}/tests/test_extension_arguments.py +0 -0
  110. {itables-2.1.2 → itables-2.1.3}/tests/test_html_in_table_header.py +0 -0
  111. {itables-2.1.2 → itables-2.1.3}/tests/test_init.py +0 -0
  112. {itables-2.1.2 → itables-2.1.3}/tests/test_javascript.py +0 -0
  113. {itables-2.1.2 → itables-2.1.3}/tests/test_json_dumps.py +0 -0
  114. {itables-2.1.2 → itables-2.1.3}/tests/test_notebook.ipynb +0 -0
  115. {itables-2.1.2 → itables-2.1.3}/tests/test_pandas_style.py +0 -0
  116. {itables-2.1.2 → itables-2.1.3}/tests/test_sample_dfs.py +0 -0
  117. {itables-2.1.2 → itables-2.1.3}/tests/test_sample_python_apps.py +0 -0
  118. {itables-2.1.2 → itables-2.1.3}/tests/test_update_samples.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: itables
3
- Version: 2.1.2
3
+ Version: 2.1.3
4
4
  Summary: Pandas and Polar DataFrames as interactive DataTables
5
5
  Project-URL: Homepage, https://mwouts.github.io/itables/
6
6
  Project-URL: Documentation, https://mwouts.github.io/itables
@@ -1,6 +1,13 @@
1
1
  ITables ChangeLog
2
2
  =================
3
3
 
4
+ 2.1.3 (2024-06-22)
5
+ ------------------
6
+
7
+ **Fixed**
8
+ - We have improved the detection of large integers in the context of Polars DataFrames ([#291](https://github.com/mwouts/itables/issues/291))
9
+
10
+
4
11
  2.1.2 (2024-06-19)
5
12
  ------------------
6
13
 
@@ -9,7 +16,7 @@ ITables ChangeLog
9
16
  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
17
 
11
18
  **Fixed**
12
- - 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))
19
+ - 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
20
 
14
21
 
15
22
  2.1.1 (2024-06-08)
@@ -129,7 +129,15 @@ def datatables_rows(df, count=None, warn_on_unexpected_types=False, pure_json=Fa
129
129
  def n_suffix_for_bigints(js, pure_json=False):
130
130
  def n_suffix(matchobj):
131
131
  if pure_json:
132
- return '"' + matchobj.group(1) + '"' + matchobj.group(2)
133
- return 'BigInt("' + matchobj.group(1) + '")' + matchobj.group(2)
132
+ return matchobj.group(1) + '"' + matchobj.group(2) + '"' + matchobj.group(3)
133
+ return (
134
+ matchobj.group(1)
135
+ + 'BigInt("'
136
+ + matchobj.group(2)
137
+ + '")'
138
+ + matchobj.group(3)
139
+ )
134
140
 
135
- return re.sub(r"(-?\d{16,})(,|])", n_suffix, js)
141
+ big_int_re = re.compile(r"^([\[\s]+)(-?\d{16,})(\]*)$")
142
+ parts = js.split(",")
143
+ return ",".join(re.sub(big_int_re, n_suffix, part) for part in parts)
@@ -1,3 +1,3 @@
1
1
  """ITables' version number"""
2
2
 
3
- __version__ = "2.1.2"
3
+ __version__ = "2.1.3"
@@ -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