promql-parser 0.3.1__tar.gz → 0.3.2__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.
- {promql_parser-0.3.1 → promql_parser-0.3.2}/Cargo.lock +98 -72
- {promql_parser-0.3.1 → promql_parser-0.3.2}/Cargo.toml +2 -2
- {promql_parser-0.3.1 → promql_parser-0.3.2}/PKG-INFO +1 -1
- {promql_parser-0.3.1 → promql_parser-0.3.2}/src/lib.rs +26 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/test_promql_parser.py +2 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/.github/workflows/CI.yml +0 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/.gitignore +0 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/LICENSE +0 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/README.md +0 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/pyproject.toml +0 -0
- {promql_parser-0.3.1 → promql_parser-0.3.2}/src/expr.rs +0 -0
|
@@ -4,9 +4,9 @@ version = 3
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "aho-corasick"
|
|
7
|
-
version = "1.
|
|
7
|
+
version = "1.1.2"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
|
|
10
10
|
dependencies = [
|
|
11
11
|
"memchr",
|
|
12
12
|
]
|
|
@@ -72,18 +72,21 @@ dependencies = [
|
|
|
72
72
|
|
|
73
73
|
[[package]]
|
|
74
74
|
name = "chrono"
|
|
75
|
-
version = "0.4.
|
|
75
|
+
version = "0.4.31"
|
|
76
76
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
77
|
-
checksum = "
|
|
77
|
+
checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
|
|
78
78
|
dependencies = [
|
|
79
79
|
"num-traits",
|
|
80
80
|
]
|
|
81
81
|
|
|
82
82
|
[[package]]
|
|
83
83
|
name = "deranged"
|
|
84
|
-
version = "0.3.
|
|
84
|
+
version = "0.3.9"
|
|
85
85
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
86
|
-
checksum = "
|
|
86
|
+
checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3"
|
|
87
|
+
dependencies = [
|
|
88
|
+
"powerfmt",
|
|
89
|
+
]
|
|
87
90
|
|
|
88
91
|
[[package]]
|
|
89
92
|
name = "enum-iterator"
|
|
@@ -102,7 +105,7 @@ checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb"
|
|
|
102
105
|
dependencies = [
|
|
103
106
|
"proc-macro2",
|
|
104
107
|
"quote",
|
|
105
|
-
"syn 2.0.
|
|
108
|
+
"syn 2.0.38",
|
|
106
109
|
]
|
|
107
110
|
|
|
108
111
|
[[package]]
|
|
@@ -113,7 +116,7 @@ checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"
|
|
|
113
116
|
dependencies = [
|
|
114
117
|
"cfg-if 1.0.0",
|
|
115
118
|
"libc",
|
|
116
|
-
"redox_syscall",
|
|
119
|
+
"redox_syscall 0.3.5",
|
|
117
120
|
"windows-sys",
|
|
118
121
|
]
|
|
119
122
|
|
|
@@ -150,6 +153,12 @@ version = "0.12.3"
|
|
|
150
153
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
151
154
|
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
|
152
155
|
|
|
156
|
+
[[package]]
|
|
157
|
+
name = "heck"
|
|
158
|
+
version = "0.4.1"
|
|
159
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
160
|
+
checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8"
|
|
161
|
+
|
|
153
162
|
[[package]]
|
|
154
163
|
name = "indexmap"
|
|
155
164
|
version = "1.9.3"
|
|
@@ -162,9 +171,9 @@ dependencies = [
|
|
|
162
171
|
|
|
163
172
|
[[package]]
|
|
164
173
|
name = "indoc"
|
|
165
|
-
version = "
|
|
174
|
+
version = "2.0.4"
|
|
166
175
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
167
|
-
checksum = "
|
|
176
|
+
checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
|
|
168
177
|
|
|
169
178
|
[[package]]
|
|
170
179
|
name = "itoa"
|
|
@@ -180,15 +189,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|
|
180
189
|
|
|
181
190
|
[[package]]
|
|
182
191
|
name = "libc"
|
|
183
|
-
version = "0.2.
|
|
192
|
+
version = "0.2.149"
|
|
184
193
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
185
|
-
checksum = "
|
|
194
|
+
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
|
186
195
|
|
|
187
196
|
[[package]]
|
|
188
197
|
name = "lock_api"
|
|
189
|
-
version = "0.4.
|
|
198
|
+
version = "0.4.11"
|
|
190
199
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
191
|
-
checksum = "
|
|
200
|
+
checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
|
|
192
201
|
dependencies = [
|
|
193
202
|
"autocfg",
|
|
194
203
|
"scopeguard",
|
|
@@ -249,9 +258,9 @@ dependencies = [
|
|
|
249
258
|
|
|
250
259
|
[[package]]
|
|
251
260
|
name = "memchr"
|
|
252
|
-
version = "2.6.
|
|
261
|
+
version = "2.6.4"
|
|
253
262
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
254
|
-
checksum = "
|
|
263
|
+
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
|
255
264
|
|
|
256
265
|
[[package]]
|
|
257
266
|
name = "memoffset"
|
|
@@ -264,9 +273,9 @@ dependencies = [
|
|
|
264
273
|
|
|
265
274
|
[[package]]
|
|
266
275
|
name = "num-traits"
|
|
267
|
-
version = "0.2.
|
|
276
|
+
version = "0.2.17"
|
|
268
277
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
269
|
-
checksum = "
|
|
278
|
+
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
|
270
279
|
dependencies = [
|
|
271
280
|
"autocfg",
|
|
272
281
|
]
|
|
@@ -299,17 +308,23 @@ dependencies = [
|
|
|
299
308
|
|
|
300
309
|
[[package]]
|
|
301
310
|
name = "parking_lot_core"
|
|
302
|
-
version = "0.9.
|
|
311
|
+
version = "0.9.9"
|
|
303
312
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
304
|
-
checksum = "
|
|
313
|
+
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
|
|
305
314
|
dependencies = [
|
|
306
315
|
"cfg-if 1.0.0",
|
|
307
316
|
"libc",
|
|
308
|
-
"redox_syscall",
|
|
317
|
+
"redox_syscall 0.4.1",
|
|
309
318
|
"smallvec",
|
|
310
319
|
"windows-targets",
|
|
311
320
|
]
|
|
312
321
|
|
|
322
|
+
[[package]]
|
|
323
|
+
name = "powerfmt"
|
|
324
|
+
version = "0.2.0"
|
|
325
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
326
|
+
checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391"
|
|
327
|
+
|
|
313
328
|
[[package]]
|
|
314
329
|
name = "proc-macro-error"
|
|
315
330
|
version = "1.0.4"
|
|
@@ -336,9 +351,9 @@ dependencies = [
|
|
|
336
351
|
|
|
337
352
|
[[package]]
|
|
338
353
|
name = "proc-macro2"
|
|
339
|
-
version = "1.0.
|
|
354
|
+
version = "1.0.69"
|
|
340
355
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
341
|
-
checksum = "
|
|
356
|
+
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
|
|
342
357
|
dependencies = [
|
|
343
358
|
"unicode-ident",
|
|
344
359
|
]
|
|
@@ -358,7 +373,7 @@ dependencies = [
|
|
|
358
373
|
|
|
359
374
|
[[package]]
|
|
360
375
|
name = "py-promql-parser"
|
|
361
|
-
version = "0.3.
|
|
376
|
+
version = "0.3.2"
|
|
362
377
|
dependencies = [
|
|
363
378
|
"chrono",
|
|
364
379
|
"promql-parser",
|
|
@@ -367,9 +382,9 @@ dependencies = [
|
|
|
367
382
|
|
|
368
383
|
[[package]]
|
|
369
384
|
name = "pyo3"
|
|
370
|
-
version = "0.
|
|
385
|
+
version = "0.20.0"
|
|
371
386
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
372
|
-
checksum = "
|
|
387
|
+
checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b"
|
|
373
388
|
dependencies = [
|
|
374
389
|
"cfg-if 1.0.0",
|
|
375
390
|
"chrono",
|
|
@@ -385,9 +400,9 @@ dependencies = [
|
|
|
385
400
|
|
|
386
401
|
[[package]]
|
|
387
402
|
name = "pyo3-build-config"
|
|
388
|
-
version = "0.
|
|
403
|
+
version = "0.20.0"
|
|
389
404
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
390
|
-
checksum = "
|
|
405
|
+
checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5"
|
|
391
406
|
dependencies = [
|
|
392
407
|
"once_cell",
|
|
393
408
|
"target-lexicon",
|
|
@@ -395,9 +410,9 @@ dependencies = [
|
|
|
395
410
|
|
|
396
411
|
[[package]]
|
|
397
412
|
name = "pyo3-ffi"
|
|
398
|
-
version = "0.
|
|
413
|
+
version = "0.20.0"
|
|
399
414
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
400
|
-
checksum = "
|
|
415
|
+
checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b"
|
|
401
416
|
dependencies = [
|
|
402
417
|
"libc",
|
|
403
418
|
"pyo3-build-config",
|
|
@@ -405,25 +420,26 @@ dependencies = [
|
|
|
405
420
|
|
|
406
421
|
[[package]]
|
|
407
422
|
name = "pyo3-macros"
|
|
408
|
-
version = "0.
|
|
423
|
+
version = "0.20.0"
|
|
409
424
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
410
|
-
checksum = "
|
|
425
|
+
checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b"
|
|
411
426
|
dependencies = [
|
|
412
427
|
"proc-macro2",
|
|
413
428
|
"pyo3-macros-backend",
|
|
414
429
|
"quote",
|
|
415
|
-
"syn
|
|
430
|
+
"syn 2.0.38",
|
|
416
431
|
]
|
|
417
432
|
|
|
418
433
|
[[package]]
|
|
419
434
|
name = "pyo3-macros-backend"
|
|
420
|
-
version = "0.
|
|
435
|
+
version = "0.20.0"
|
|
421
436
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
422
|
-
checksum = "
|
|
437
|
+
checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424"
|
|
423
438
|
dependencies = [
|
|
439
|
+
"heck",
|
|
424
440
|
"proc-macro2",
|
|
425
441
|
"quote",
|
|
426
|
-
"syn
|
|
442
|
+
"syn 2.0.38",
|
|
427
443
|
]
|
|
428
444
|
|
|
429
445
|
[[package]]
|
|
@@ -444,11 +460,20 @@ dependencies = [
|
|
|
444
460
|
"bitflags",
|
|
445
461
|
]
|
|
446
462
|
|
|
463
|
+
[[package]]
|
|
464
|
+
name = "redox_syscall"
|
|
465
|
+
version = "0.4.1"
|
|
466
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
467
|
+
checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa"
|
|
468
|
+
dependencies = [
|
|
469
|
+
"bitflags",
|
|
470
|
+
]
|
|
471
|
+
|
|
447
472
|
[[package]]
|
|
448
473
|
name = "regex"
|
|
449
|
-
version = "1.
|
|
474
|
+
version = "1.10.2"
|
|
450
475
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
451
|
-
checksum = "
|
|
476
|
+
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
|
452
477
|
dependencies = [
|
|
453
478
|
"aho-corasick",
|
|
454
479
|
"memchr",
|
|
@@ -458,9 +483,9 @@ dependencies = [
|
|
|
458
483
|
|
|
459
484
|
[[package]]
|
|
460
485
|
name = "regex-automata"
|
|
461
|
-
version = "0.3
|
|
486
|
+
version = "0.4.3"
|
|
462
487
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
463
|
-
checksum = "
|
|
488
|
+
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
|
464
489
|
dependencies = [
|
|
465
490
|
"aho-corasick",
|
|
466
491
|
"memchr",
|
|
@@ -469,9 +494,9 @@ dependencies = [
|
|
|
469
494
|
|
|
470
495
|
[[package]]
|
|
471
496
|
name = "regex-syntax"
|
|
472
|
-
version = "0.
|
|
497
|
+
version = "0.8.2"
|
|
473
498
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
474
|
-
checksum = "
|
|
499
|
+
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
|
475
500
|
|
|
476
501
|
[[package]]
|
|
477
502
|
name = "rustc_version"
|
|
@@ -496,35 +521,35 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
496
521
|
|
|
497
522
|
[[package]]
|
|
498
523
|
name = "semver"
|
|
499
|
-
version = "1.0.
|
|
524
|
+
version = "1.0.20"
|
|
500
525
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
501
|
-
checksum = "
|
|
526
|
+
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
|
502
527
|
|
|
503
528
|
[[package]]
|
|
504
529
|
name = "serde"
|
|
505
|
-
version = "1.0.
|
|
530
|
+
version = "1.0.190"
|
|
506
531
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
507
|
-
checksum = "
|
|
532
|
+
checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7"
|
|
508
533
|
dependencies = [
|
|
509
534
|
"serde_derive",
|
|
510
535
|
]
|
|
511
536
|
|
|
512
537
|
[[package]]
|
|
513
538
|
name = "serde_derive"
|
|
514
|
-
version = "1.0.
|
|
539
|
+
version = "1.0.190"
|
|
515
540
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
516
|
-
checksum = "
|
|
541
|
+
checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3"
|
|
517
542
|
dependencies = [
|
|
518
543
|
"proc-macro2",
|
|
519
544
|
"quote",
|
|
520
|
-
"syn 2.0.
|
|
545
|
+
"syn 2.0.38",
|
|
521
546
|
]
|
|
522
547
|
|
|
523
548
|
[[package]]
|
|
524
549
|
name = "smallvec"
|
|
525
|
-
version = "1.11.
|
|
550
|
+
version = "1.11.1"
|
|
526
551
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
527
|
-
checksum = "
|
|
552
|
+
checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a"
|
|
528
553
|
|
|
529
554
|
[[package]]
|
|
530
555
|
name = "sparsevec"
|
|
@@ -557,9 +582,9 @@ dependencies = [
|
|
|
557
582
|
|
|
558
583
|
[[package]]
|
|
559
584
|
name = "syn"
|
|
560
|
-
version = "2.0.
|
|
585
|
+
version = "2.0.38"
|
|
561
586
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
562
|
-
checksum = "
|
|
587
|
+
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
|
563
588
|
dependencies = [
|
|
564
589
|
"proc-macro2",
|
|
565
590
|
"quote",
|
|
@@ -568,38 +593,39 @@ dependencies = [
|
|
|
568
593
|
|
|
569
594
|
[[package]]
|
|
570
595
|
name = "target-lexicon"
|
|
571
|
-
version = "0.12.
|
|
596
|
+
version = "0.12.12"
|
|
572
597
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
573
|
-
checksum = "
|
|
598
|
+
checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a"
|
|
574
599
|
|
|
575
600
|
[[package]]
|
|
576
601
|
name = "thiserror"
|
|
577
|
-
version = "1.0.
|
|
602
|
+
version = "1.0.50"
|
|
578
603
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
579
|
-
checksum = "
|
|
604
|
+
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
|
|
580
605
|
dependencies = [
|
|
581
606
|
"thiserror-impl",
|
|
582
607
|
]
|
|
583
608
|
|
|
584
609
|
[[package]]
|
|
585
610
|
name = "thiserror-impl"
|
|
586
|
-
version = "1.0.
|
|
611
|
+
version = "1.0.50"
|
|
587
612
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
588
|
-
checksum = "
|
|
613
|
+
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
|
|
589
614
|
dependencies = [
|
|
590
615
|
"proc-macro2",
|
|
591
616
|
"quote",
|
|
592
|
-
"syn 2.0.
|
|
617
|
+
"syn 2.0.38",
|
|
593
618
|
]
|
|
594
619
|
|
|
595
620
|
[[package]]
|
|
596
621
|
name = "time"
|
|
597
|
-
version = "0.3.
|
|
622
|
+
version = "0.3.30"
|
|
598
623
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
599
|
-
checksum = "
|
|
624
|
+
checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
|
|
600
625
|
dependencies = [
|
|
601
626
|
"deranged",
|
|
602
627
|
"itoa",
|
|
628
|
+
"powerfmt",
|
|
603
629
|
"serde",
|
|
604
630
|
"time-core",
|
|
605
631
|
"time-macros",
|
|
@@ -607,15 +633,15 @@ dependencies = [
|
|
|
607
633
|
|
|
608
634
|
[[package]]
|
|
609
635
|
name = "time-core"
|
|
610
|
-
version = "0.1.
|
|
636
|
+
version = "0.1.2"
|
|
611
637
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
612
|
-
checksum = "
|
|
638
|
+
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
|
613
639
|
|
|
614
640
|
[[package]]
|
|
615
641
|
name = "time-macros"
|
|
616
|
-
version = "0.2.
|
|
642
|
+
version = "0.2.15"
|
|
617
643
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
618
|
-
checksum = "
|
|
644
|
+
checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
|
|
619
645
|
dependencies = [
|
|
620
646
|
"time-core",
|
|
621
647
|
]
|
|
@@ -631,21 +657,21 @@ dependencies = [
|
|
|
631
657
|
|
|
632
658
|
[[package]]
|
|
633
659
|
name = "unicode-ident"
|
|
634
|
-
version = "1.0.
|
|
660
|
+
version = "1.0.12"
|
|
635
661
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
636
|
-
checksum = "
|
|
662
|
+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
|
637
663
|
|
|
638
664
|
[[package]]
|
|
639
665
|
name = "unicode-width"
|
|
640
|
-
version = "0.1.
|
|
666
|
+
version = "0.1.11"
|
|
641
667
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
642
|
-
checksum = "
|
|
668
|
+
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
|
|
643
669
|
|
|
644
670
|
[[package]]
|
|
645
671
|
name = "unindent"
|
|
646
|
-
version = "0.
|
|
672
|
+
version = "0.2.3"
|
|
647
673
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
648
|
-
checksum = "
|
|
674
|
+
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
|
|
649
675
|
|
|
650
676
|
[[package]]
|
|
651
677
|
name = "vergen"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "py-promql-parser"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.2"
|
|
4
4
|
edition = "2021"
|
|
5
5
|
description = "PromQL Parser for Python"
|
|
6
6
|
license = "MIT"
|
|
@@ -15,4 +15,4 @@ crate-type = ["cdylib"]
|
|
|
15
15
|
[dependencies]
|
|
16
16
|
chrono = { version = "0.4.23", default-features = false, features = ["std"] }
|
|
17
17
|
promql-parser = "0.3.0"
|
|
18
|
-
pyo3 = { version = "0.
|
|
18
|
+
pyo3 = { version = "0.20.0", features = ["chrono", "extension-module"] }
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
use pyo3::exceptions::PyValueError;
|
|
1
2
|
use pyo3::prelude::*;
|
|
3
|
+
use pyo3::types::{PyDelta, PyDeltaAccess};
|
|
2
4
|
|
|
3
5
|
mod expr;
|
|
4
6
|
|
|
@@ -10,6 +12,28 @@ fn parse(py: Python, input: &str) -> PyResult<PyObject> {
|
|
|
10
12
|
PyExpr::parse(py, input)
|
|
11
13
|
}
|
|
12
14
|
|
|
15
|
+
#[pyfunction]
|
|
16
|
+
fn parse_duration<'p>(py: Python<'p>, duration: &str) -> PyResult<&'p PyDelta> {
|
|
17
|
+
let duration =
|
|
18
|
+
::promql_parser::util::duration::parse_duration(duration).map_err(PyValueError::new_err)?;
|
|
19
|
+
PyDelta::new(
|
|
20
|
+
py,
|
|
21
|
+
0,
|
|
22
|
+
duration.as_secs().try_into().unwrap(),
|
|
23
|
+
duration.subsec_millis().try_into().unwrap(),
|
|
24
|
+
false,
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
#[pyfunction]
|
|
29
|
+
fn display_duration(delta: &PyDelta) -> String {
|
|
30
|
+
let duration = std::time::Duration::new(
|
|
31
|
+
delta.get_days() as u64 * 24 * 60 * 60 + delta.get_seconds() as u64,
|
|
32
|
+
delta.get_microseconds() as u32 * 1000,
|
|
33
|
+
);
|
|
34
|
+
::promql_parser::util::duration::display_duration(&duration)
|
|
35
|
+
}
|
|
36
|
+
|
|
13
37
|
/// A Python module implemented in Rust.
|
|
14
38
|
#[pymodule]
|
|
15
39
|
fn promql_parser(_py: Python, m: &PyModule) -> PyResult<()> {
|
|
@@ -38,5 +62,7 @@ fn promql_parser(_py: Python, m: &PyModule) -> PyResult<()> {
|
|
|
38
62
|
m.add_class::<expr::PyValueType>()?;
|
|
39
63
|
m.add_class::<expr::PyFunction>()?;
|
|
40
64
|
m.add_function(wrap_pyfunction!(parse, m)?)?;
|
|
65
|
+
m.add_function(wrap_pyfunction!(parse_duration, m)?)?;
|
|
66
|
+
m.add_function(wrap_pyfunction!(display_duration, m)?)?;
|
|
41
67
|
Ok(())
|
|
42
68
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|