xml2arrow 0.7.0__tar.gz → 0.8.0__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.
@@ -4,7 +4,7 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "_xml2arrow"
7
- version = "0.7.0"
7
+ version = "0.8.0"
8
8
  dependencies = [
9
9
  "arrow",
10
10
  "pyo3",
@@ -52,9 +52,9 @@ dependencies = [
52
52
 
53
53
  [[package]]
54
54
  name = "arrow"
55
- version = "54.0.0"
55
+ version = "54.2.0"
56
56
  source = "registry+https://github.com/rust-lang/crates.io-index"
57
- checksum = "d2ccdcc8fb14508ca20aaec7076032e5c0b0751b906036d4496786e2f227a37a"
57
+ checksum = "755b6da235ac356a869393c23668c663720b8749dd6f15e52b6c214b4b964cc7"
58
58
  dependencies = [
59
59
  "arrow-arith",
60
60
  "arrow-array",
@@ -74,9 +74,9 @@ dependencies = [
74
74
 
75
75
  [[package]]
76
76
  name = "arrow-arith"
77
- version = "54.0.0"
77
+ version = "54.2.0"
78
78
  source = "registry+https://github.com/rust-lang/crates.io-index"
79
- checksum = "a1aad8e27f32e411a0fc0bf5a625a35f0bf9b9f871cf4542abe31f7cef4beea2"
79
+ checksum = "64656a1e0b13ca766f8440752e9a93e11014eec7b67909986f83ed0ab1fe37b8"
80
80
  dependencies = [
81
81
  "arrow-array",
82
82
  "arrow-buffer",
@@ -88,9 +88,9 @@ dependencies = [
88
88
 
89
89
  [[package]]
90
90
  name = "arrow-array"
91
- version = "54.0.0"
91
+ version = "54.2.0"
92
92
  source = "registry+https://github.com/rust-lang/crates.io-index"
93
- checksum = "bd6ed90c28c6f73a706c55799b8cc3a094e89257238e5b1d65ca7c70bd3ae23f"
93
+ checksum = "57a4a6d2896083cfbdf84a71a863b22460d0708f8206a8373c52e326cc72ea1a"
94
94
  dependencies = [
95
95
  "ahash",
96
96
  "arrow-buffer",
@@ -104,9 +104,9 @@ dependencies = [
104
104
 
105
105
  [[package]]
106
106
  name = "arrow-buffer"
107
- version = "54.0.0"
107
+ version = "54.2.0"
108
108
  source = "registry+https://github.com/rust-lang/crates.io-index"
109
- checksum = "fe4a40bdc1552ea10fbdeae4e5a945d8572c32f66bce457b96c13d9c46b80447"
109
+ checksum = "cef870583ce5e4f3b123c181706f2002fb134960f9a911900f64ba4830c7a43a"
110
110
  dependencies = [
111
111
  "bytes",
112
112
  "half",
@@ -115,9 +115,9 @@ dependencies = [
115
115
 
116
116
  [[package]]
117
117
  name = "arrow-cast"
118
- version = "54.0.0"
118
+ version = "54.2.0"
119
119
  source = "registry+https://github.com/rust-lang/crates.io-index"
120
- checksum = "430c0a21aa7f81bcf0f97c57216d7127795ea755f494d27bae2bd233be43c2cc"
120
+ checksum = "1ac7eba5a987f8b4a7d9629206ba48e19a1991762795bbe5d08497b7736017ee"
121
121
  dependencies = [
122
122
  "arrow-array",
123
123
  "arrow-buffer",
@@ -135,9 +135,9 @@ dependencies = [
135
135
 
136
136
  [[package]]
137
137
  name = "arrow-csv"
138
- version = "54.0.0"
138
+ version = "54.2.0"
139
139
  source = "registry+https://github.com/rust-lang/crates.io-index"
140
- checksum = "b4444c8f8c57ac00e6a679ede67d1ae8872c170797dc45b46f75702437a77888"
140
+ checksum = "90f12542b8164398fc9ec595ff783c4cf6044daa89622c5a7201be920e4c0d4c"
141
141
  dependencies = [
142
142
  "arrow-array",
143
143
  "arrow-cast",
@@ -151,9 +151,9 @@ dependencies = [
151
151
 
152
152
  [[package]]
153
153
  name = "arrow-data"
154
- version = "54.0.0"
154
+ version = "54.2.0"
155
155
  source = "registry+https://github.com/rust-lang/crates.io-index"
156
- checksum = "09af476cfbe9879937e50b1334c73189de6039186e025b1b1ac84b283b87b20e"
156
+ checksum = "b095e8a4f3c309544935d53e04c3bfe4eea4e71c3de6fe0416d1f08bb4441a83"
157
157
  dependencies = [
158
158
  "arrow-buffer",
159
159
  "arrow-schema",
@@ -163,9 +163,9 @@ dependencies = [
163
163
 
164
164
  [[package]]
165
165
  name = "arrow-ipc"
166
- version = "54.0.0"
166
+ version = "54.2.0"
167
167
  source = "registry+https://github.com/rust-lang/crates.io-index"
168
- checksum = "136296e8824333a8a4c4a6e508e4aa65d5678b801246d0408825ae7b2523c628"
168
+ checksum = "65c63da4afedde2b25ef69825cd4663ca76f78f79ffe2d057695742099130ff6"
169
169
  dependencies = [
170
170
  "arrow-array",
171
171
  "arrow-buffer",
@@ -176,9 +176,9 @@ dependencies = [
176
176
 
177
177
  [[package]]
178
178
  name = "arrow-json"
179
- version = "54.0.0"
179
+ version = "54.2.0"
180
180
  source = "registry+https://github.com/rust-lang/crates.io-index"
181
- checksum = "e222ad0e419ab8276818c5605a5bb1e35ed86fa8c5e550726433cc63b09c3c78"
181
+ checksum = "9551d9400532f23a370cabbea1dc5a53c49230397d41f96c4c8eedf306199305"
182
182
  dependencies = [
183
183
  "arrow-array",
184
184
  "arrow-buffer",
@@ -196,9 +196,9 @@ dependencies = [
196
196
 
197
197
  [[package]]
198
198
  name = "arrow-ord"
199
- version = "54.0.0"
199
+ version = "54.2.0"
200
200
  source = "registry+https://github.com/rust-lang/crates.io-index"
201
- checksum = "eddf14c5f03b679ec8ceac4dfac43f63cdc4ed54dab3cc120a4ef46af38481eb"
201
+ checksum = "6c07223476f8219d1ace8cd8d85fa18c4ebd8d945013f25ef5c72e85085ca4ee"
202
202
  dependencies = [
203
203
  "arrow-array",
204
204
  "arrow-buffer",
@@ -209,9 +209,9 @@ dependencies = [
209
209
 
210
210
  [[package]]
211
211
  name = "arrow-row"
212
- version = "54.0.0"
212
+ version = "54.2.0"
213
213
  source = "registry+https://github.com/rust-lang/crates.io-index"
214
- checksum = "e9acdc58da19f383f4ba381fa0e3583534ae2ceb31269aaf4a03f08ff13e8443"
214
+ checksum = "91b194b38bfd89feabc23e798238989c6648b2506ad639be42ec8eb1658d82c4"
215
215
  dependencies = [
216
216
  "arrow-array",
217
217
  "arrow-buffer",
@@ -222,18 +222,18 @@ dependencies = [
222
222
 
223
223
  [[package]]
224
224
  name = "arrow-schema"
225
- version = "54.0.0"
225
+ version = "54.2.0"
226
226
  source = "registry+https://github.com/rust-lang/crates.io-index"
227
- checksum = "3a1822a1a952955637e85e8f9d6b0e04dd75d65492b87ec548dd593d3a1f772b"
227
+ checksum = "0f40f6be8f78af1ab610db7d9b236e21d587b7168e368a36275d2e5670096735"
228
228
  dependencies = [
229
229
  "bitflags 2.6.0",
230
230
  ]
231
231
 
232
232
  [[package]]
233
233
  name = "arrow-select"
234
- version = "54.0.0"
234
+ version = "54.2.0"
235
235
  source = "registry+https://github.com/rust-lang/crates.io-index"
236
- checksum = "5c4172e9a12dfe15303d3926269f9ead471ea93bdd067d113abc65cb6c48e246"
236
+ checksum = "ac265273864a820c4a179fc67182ccc41ea9151b97024e1be956f0f2369c2539"
237
237
  dependencies = [
238
238
  "ahash",
239
239
  "arrow-array",
@@ -245,9 +245,9 @@ dependencies = [
245
245
 
246
246
  [[package]]
247
247
  name = "arrow-string"
248
- version = "54.0.0"
248
+ version = "54.2.0"
249
249
  source = "registry+https://github.com/rust-lang/crates.io-index"
250
- checksum = "73683040445f4932342781926189901c9521bb1a787c35dbe628a3ce51372d3c"
250
+ checksum = "d44c8eed43be4ead49128370f7131f054839d3d6003e52aebf64322470b8fbd0"
251
251
  dependencies = [
252
252
  "arrow-array",
253
253
  "arrow-buffer",
@@ -430,18 +430,18 @@ dependencies = [
430
430
 
431
431
  [[package]]
432
432
  name = "derive_more"
433
- version = "1.0.0"
433
+ version = "2.0.1"
434
434
  source = "registry+https://github.com/rust-lang/crates.io-index"
435
- checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05"
435
+ checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678"
436
436
  dependencies = [
437
437
  "derive_more-impl",
438
438
  ]
439
439
 
440
440
  [[package]]
441
441
  name = "derive_more-impl"
442
- version = "1.0.0"
442
+ version = "2.0.1"
443
443
  source = "registry+https://github.com/rust-lang/crates.io-index"
444
- checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22"
444
+ checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3"
445
445
  dependencies = [
446
446
  "proc-macro2",
447
447
  "quote",
@@ -823,9 +823,9 @@ dependencies = [
823
823
 
824
824
  [[package]]
825
825
  name = "phf_shared"
826
- version = "0.10.0"
826
+ version = "0.11.3"
827
827
  source = "registry+https://github.com/rust-lang/crates.io-index"
828
- checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096"
828
+ checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5"
829
829
  dependencies = [
830
830
  "siphasher",
831
831
  ]
@@ -864,9 +864,9 @@ dependencies = [
864
864
 
865
865
  [[package]]
866
866
  name = "pyo3"
867
- version = "0.23.3"
867
+ version = "0.23.4"
868
868
  source = "registry+https://github.com/rust-lang/crates.io-index"
869
- checksum = "e484fd2c8b4cb67ab05a318f1fd6fa8f199fcc30819f08f07d200809dba26c15"
869
+ checksum = "57fe09249128b3173d092de9523eaa75136bf7ba85e0d69eca241c7939c933cc"
870
870
  dependencies = [
871
871
  "cfg-if",
872
872
  "indoc",
@@ -882,9 +882,9 @@ dependencies = [
882
882
 
883
883
  [[package]]
884
884
  name = "pyo3-build-config"
885
- version = "0.23.3"
885
+ version = "0.23.4"
886
886
  source = "registry+https://github.com/rust-lang/crates.io-index"
887
- checksum = "dc0e0469a84f208e20044b98965e1561028180219e35352a2afaf2b942beff3b"
887
+ checksum = "1cd3927b5a78757a0d71aa9dff669f903b1eb64b54142a9bd9f757f8fde65fd7"
888
888
  dependencies = [
889
889
  "once_cell",
890
890
  "target-lexicon",
@@ -892,9 +892,9 @@ dependencies = [
892
892
 
893
893
  [[package]]
894
894
  name = "pyo3-ffi"
895
- version = "0.23.3"
895
+ version = "0.23.4"
896
896
  source = "registry+https://github.com/rust-lang/crates.io-index"
897
- checksum = "eb1547a7f9966f6f1a0f0227564a9945fe36b90da5a93b3933fc3dc03fae372d"
897
+ checksum = "dab6bb2102bd8f991e7749f130a70d05dd557613e39ed2deeee8e9ca0c4d548d"
898
898
  dependencies = [
899
899
  "libc",
900
900
  "pyo3-build-config",
@@ -912,9 +912,9 @@ dependencies = [
912
912
 
913
913
  [[package]]
914
914
  name = "pyo3-macros"
915
- version = "0.23.3"
915
+ version = "0.23.4"
916
916
  source = "registry+https://github.com/rust-lang/crates.io-index"
917
- checksum = "fdb6da8ec6fa5cedd1626c886fc8749bdcbb09424a86461eb8cdf096b7c33257"
917
+ checksum = "91871864b353fd5ffcb3f91f2f703a22a9797c91b9ab497b1acac7b07ae509c7"
918
918
  dependencies = [
919
919
  "proc-macro2",
920
920
  "pyo3-macros-backend",
@@ -924,9 +924,9 @@ dependencies = [
924
924
 
925
925
  [[package]]
926
926
  name = "pyo3-macros-backend"
927
- version = "0.23.3"
927
+ version = "0.23.4"
928
928
  source = "registry+https://github.com/rust-lang/crates.io-index"
929
- checksum = "38a385202ff5a92791168b1136afae5059d3ac118457bb7bc304c197c2d33e7d"
929
+ checksum = "43abc3b80bc20f3facd86cd3c60beed58c3e2aa26213f3cda368de39c60a27e4"
930
930
  dependencies = [
931
931
  "heck",
932
932
  "proc-macro2",
@@ -1045,18 +1045,18 @@ dependencies = [
1045
1045
 
1046
1046
  [[package]]
1047
1047
  name = "serde"
1048
- version = "1.0.217"
1048
+ version = "1.0.218"
1049
1049
  source = "registry+https://github.com/rust-lang/crates.io-index"
1050
- checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70"
1050
+ checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60"
1051
1051
  dependencies = [
1052
1052
  "serde_derive",
1053
1053
  ]
1054
1054
 
1055
1055
  [[package]]
1056
1056
  name = "serde_derive"
1057
- version = "1.0.217"
1057
+ version = "1.0.218"
1058
1058
  source = "registry+https://github.com/rust-lang/crates.io-index"
1059
- checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0"
1059
+ checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b"
1060
1060
  dependencies = [
1061
1061
  "proc-macro2",
1062
1062
  "quote",
@@ -1096,9 +1096,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64"
1096
1096
 
1097
1097
  [[package]]
1098
1098
  name = "siphasher"
1099
- version = "0.3.11"
1099
+ version = "1.0.1"
1100
1100
  source = "registry+https://github.com/rust-lang/crates.io-index"
1101
- checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d"
1101
+ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
1102
1102
 
1103
1103
  [[package]]
1104
1104
  name = "skeptic"
@@ -1129,12 +1129,11 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
1129
1129
 
1130
1130
  [[package]]
1131
1131
  name = "string_cache"
1132
- version = "0.8.7"
1132
+ version = "0.8.8"
1133
1133
  source = "registry+https://github.com/rust-lang/crates.io-index"
1134
- checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b"
1134
+ checksum = "938d512196766101d333398efde81bc1f37b00cb42c2f8350e5df639f040bbbe"
1135
1135
  dependencies = [
1136
1136
  "new_debug_unreachable",
1137
- "once_cell",
1138
1137
  "parking_lot",
1139
1138
  "phf_shared",
1140
1139
  "precomputed-hash",
@@ -1373,9 +1372,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec"
1373
1372
 
1374
1373
  [[package]]
1375
1374
  name = "xml2arrow"
1376
- version = "0.7.0"
1375
+ version = "0.8.0"
1377
1376
  source = "registry+https://github.com/rust-lang/crates.io-index"
1378
- checksum = "f5125d5c3990fc5a61b1daf20305e75b7a7253f20df9645fb5737d95442bccea"
1377
+ checksum = "129f6ea4977d9a45e31dafba3b9b79f5d274c8256596ee2776ad3f2356f77334"
1379
1378
  dependencies = [
1380
1379
  "arrow",
1381
1380
  "derive_more",
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "_xml2arrow"
3
- version = "0.7.0"
3
+ version = "0.8.0"
4
4
  edition = "2021"
5
5
 
6
6
  # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
@@ -9,10 +9,10 @@ name = "_xml2arrow"
9
9
  crate-type = ["cdylib"]
10
10
 
11
11
  [dependencies]
12
- xml2arrow = { version = "0.7.0", features = ["python"] }
13
- arrow = { version = "54.0.0", features = ["pyarrow", "pyo3"] }
12
+ xml2arrow = { version = "0.8.0", features = ["python"] }
13
+ arrow = { version = "54.2.0", features = ["pyarrow", "pyo3"] }
14
14
  pyo3-file = "0.10.0"
15
15
 
16
16
  [dependencies.pyo3]
17
- version = "0.23.3"
17
+ version = "0.23.4"
18
18
  features = ["extension-module", "abi3-py310"]
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: xml2arrow
3
- Version: 0.7.0
3
+ Version: 0.8.0
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: Implementation :: CPython
6
6
  Classifier: License :: OSI Approved :: MIT License
@@ -15,8 +15,8 @@ Classifier: Topic :: Text Processing :: Markup :: XML
15
15
  Classifier: Intended Audience :: Developers
16
16
  Classifier: Intended Audience :: Science/Research
17
17
  Classifier: Operating System :: OS Independent
18
- Requires-Dist: pyarrow >=14.0.0
19
- Requires-Dist: pytest ==8.3.4 ; extra == 'test'
18
+ Requires-Dist: pyarrow>=14.0.0
19
+ Requires-Dist: pytest==8.3.4 ; extra == 'test'
20
20
  Provides-Extra: test
21
21
  License-File: LICENSE
22
22
  Summary: Efficiently convert XML data to Apache Arrow format.
@@ -4,6 +4,7 @@ from ._xml2arrow import (
4
4
  NoTableOnStackError,
5
5
  ParseError,
6
6
  TableNotFoundError,
7
+ UnsupportedConversionError,
7
8
  UnsupportedDataTypeError,
8
9
  Xml2ArrowError,
9
10
  XmlParsingError,
@@ -18,4 +19,5 @@ __all__ = [
18
19
  "TableNotFoundError",
19
20
  "NoTableOnStackError",
20
21
  "ParseError",
22
+ "UnsupportedConversionError",
21
23
  ]
@@ -6,8 +6,8 @@ use std::io::{BufReader, Read};
6
6
  use std::path::PathBuf;
7
7
  use xml2arrow::config::Config;
8
8
  use xml2arrow::errors::{
9
- NoTableOnStackError, ParseError, TableNotFoundError, UnsupportedDataTypeError, Xml2ArrowError,
10
- XmlParsingError, YamlParsingError,
9
+ NoTableOnStackError, ParseError, TableNotFoundError, UnsupportedConversionError,
10
+ UnsupportedDataTypeError, Xml2ArrowError, XmlParsingError, YamlParsingError,
11
11
  };
12
12
  use xml2arrow::parse_xml;
13
13
 
@@ -119,6 +119,10 @@ fn _xml2arrow(py: Python<'_>, m: &Bound<'_, PyModule>) -> PyResult<()> {
119
119
  m.add("TableNotFoundError", py.get_type::<TableNotFoundError>())?;
120
120
  m.add("NoTableOnStackError", py.get_type::<NoTableOnStackError>())?;
121
121
  m.add("ParseError", py.get_type::<ParseError>())?;
122
+ m.add(
123
+ "UnsupportedConversionError",
124
+ py.get_type::<UnsupportedConversionError>(),
125
+ )?;
122
126
  m.add_wrapped(wrap_pyfunction!(_get_version))?;
123
127
  Ok(())
124
128
  }
@@ -4,7 +4,11 @@ from pathlib import Path
4
4
  import pyarrow as pa
5
5
  import pytest
6
6
  from xml2arrow import XmlToArrowParser
7
- from xml2arrow.exceptions import ParseError, YamlParsingError
7
+ from xml2arrow.exceptions import (
8
+ ParseError,
9
+ UnsupportedConversionError,
10
+ YamlParsingError,
11
+ )
8
12
 
9
13
 
10
14
  @pytest.fixture(scope="module")
@@ -174,3 +178,41 @@ def test_xml_to_arrow_parse_parse_error(parser: XmlToArrowParser) -> None:
174
178
  f.flush() # Ensure data is written to the file
175
179
  f.seek(0) # Reset the file pointer to the beginning
176
180
  parser.parse(f)
181
+
182
+
183
+ def test_unsupported_conversion_error():
184
+ config_yaml = """
185
+ tables:
186
+ - name: test_table
187
+ xml_path: /root
188
+ levels: []
189
+ fields:
190
+ - name: test_field
191
+ xml_path: /root/field
192
+ data_type: Int32
193
+ nullable: false
194
+ scale: 2.0
195
+ """
196
+
197
+ xml_data = """
198
+ <root>
199
+ <field>10</field>
200
+ </root>
201
+ """
202
+
203
+ config_path = Path("test_config.yaml")
204
+ config_path.write_text(config_yaml)
205
+
206
+ xml_path = Path("test_data.xml")
207
+ xml_path.write_text(xml_data)
208
+
209
+ parser = XmlToArrowParser(config_path)
210
+
211
+ with pytest.raises(UnsupportedConversionError) as excinfo:
212
+ parser.parse(xml_path)
213
+
214
+ assert "Scaling is only supported for Float32 and Float64" in str(excinfo.value)
215
+ assert "Int32" in str(excinfo.value)
216
+
217
+ config_path.unlink()
218
+ xml_path.unlink()
File without changes
File without changes
File without changes
File without changes