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.
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/Cargo.lock +55 -56
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/Cargo.toml +4 -4
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/PKG-INFO +3 -3
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/python/xml2arrow/exceptions.py +2 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/src/lib.rs +6 -2
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/tests/test_xml2arrow.py +43 -1
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/.github/workflows/CI.yml +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/.gitignore +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/LICENSE +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/README.md +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/pyproject.toml +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/python/xml2arrow/__init__.py +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/python/xml2arrow/_xml2arrow.pyi +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/python/xml2arrow/py.typed +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/tests/test_data/stations.xml +0 -0
- {xml2arrow-0.7.0 → xml2arrow-0.8.0}/tests/test_data/stations.yaml +0 -0
|
@@ -4,7 +4,7 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "_xml2arrow"
|
|
7
|
-
version = "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.
|
|
55
|
+
version = "54.2.0"
|
|
56
56
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
57
|
-
checksum = "
|
|
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.
|
|
77
|
+
version = "54.2.0"
|
|
78
78
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
79
|
-
checksum = "
|
|
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.
|
|
91
|
+
version = "54.2.0"
|
|
92
92
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
-
checksum = "
|
|
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.
|
|
107
|
+
version = "54.2.0"
|
|
108
108
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
109
|
-
checksum = "
|
|
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.
|
|
118
|
+
version = "54.2.0"
|
|
119
119
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
120
|
-
checksum = "
|
|
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.
|
|
138
|
+
version = "54.2.0"
|
|
139
139
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
140
|
-
checksum = "
|
|
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.
|
|
154
|
+
version = "54.2.0"
|
|
155
155
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
156
|
-
checksum = "
|
|
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.
|
|
166
|
+
version = "54.2.0"
|
|
167
167
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
168
|
-
checksum = "
|
|
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.
|
|
179
|
+
version = "54.2.0"
|
|
180
180
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
181
|
-
checksum = "
|
|
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.
|
|
199
|
+
version = "54.2.0"
|
|
200
200
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
201
|
-
checksum = "
|
|
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.
|
|
212
|
+
version = "54.2.0"
|
|
213
213
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
214
|
-
checksum = "
|
|
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.
|
|
225
|
+
version = "54.2.0"
|
|
226
226
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
227
|
-
checksum = "
|
|
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.
|
|
234
|
+
version = "54.2.0"
|
|
235
235
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
236
|
-
checksum = "
|
|
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.
|
|
248
|
+
version = "54.2.0"
|
|
249
249
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
250
|
-
checksum = "
|
|
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 = "
|
|
433
|
+
version = "2.0.1"
|
|
434
434
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
435
|
-
checksum = "
|
|
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 = "
|
|
442
|
+
version = "2.0.1"
|
|
443
443
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
444
|
-
checksum = "
|
|
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.
|
|
826
|
+
version = "0.11.3"
|
|
827
827
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
828
|
-
checksum = "
|
|
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.
|
|
867
|
+
version = "0.23.4"
|
|
868
868
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
869
|
-
checksum = "
|
|
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.
|
|
885
|
+
version = "0.23.4"
|
|
886
886
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
887
|
-
checksum = "
|
|
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.
|
|
895
|
+
version = "0.23.4"
|
|
896
896
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
897
|
-
checksum = "
|
|
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.
|
|
915
|
+
version = "0.23.4"
|
|
916
916
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
917
|
-
checksum = "
|
|
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.
|
|
927
|
+
version = "0.23.4"
|
|
928
928
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
929
|
-
checksum = "
|
|
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.
|
|
1048
|
+
version = "1.0.218"
|
|
1049
1049
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1050
|
-
checksum = "
|
|
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.
|
|
1057
|
+
version = "1.0.218"
|
|
1058
1058
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1059
|
-
checksum = "
|
|
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.
|
|
1099
|
+
version = "1.0.1"
|
|
1100
1100
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1101
|
-
checksum = "
|
|
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.
|
|
1132
|
+
version = "0.8.8"
|
|
1133
1133
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1134
|
-
checksum = "
|
|
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.
|
|
1375
|
+
version = "0.8.0"
|
|
1377
1376
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
1378
|
-
checksum = "
|
|
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.
|
|
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.
|
|
13
|
-
arrow = { version = "54.
|
|
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.
|
|
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.
|
|
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
|
|
19
|
-
Requires-Dist: pytest
|
|
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,
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|