promql-parser 0.3.0__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.0 → promql_parser-0.3.2}/Cargo.lock +118 -99
- {promql_parser-0.3.0 → promql_parser-0.3.2}/Cargo.toml +2 -2
- {promql_parser-0.3.0 → promql_parser-0.3.2}/PKG-INFO +1 -1
- {promql_parser-0.3.0 → promql_parser-0.3.2}/src/expr.rs +7 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/src/lib.rs +26 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/test_promql_parser.py +2 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/.github/workflows/CI.yml +0 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/.gitignore +0 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/LICENSE +0 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/README.md +0 -0
- {promql_parser-0.3.0 → promql_parser-0.3.2}/pyproject.toml +0 -0
|
@@ -4,24 +4,18 @@ 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
|
]
|
|
13
13
|
|
|
14
|
-
[[package]]
|
|
15
|
-
name = "android-tzdata"
|
|
16
|
-
version = "0.1.1"
|
|
17
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
18
|
-
checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0"
|
|
19
|
-
|
|
20
14
|
[[package]]
|
|
21
15
|
name = "anyhow"
|
|
22
|
-
version = "1.0.
|
|
16
|
+
version = "1.0.75"
|
|
23
17
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
24
|
-
checksum = "
|
|
18
|
+
checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6"
|
|
25
19
|
|
|
26
20
|
[[package]]
|
|
27
21
|
name = "autocfg"
|
|
@@ -78,19 +72,21 @@ dependencies = [
|
|
|
78
72
|
|
|
79
73
|
[[package]]
|
|
80
74
|
name = "chrono"
|
|
81
|
-
version = "0.4.
|
|
75
|
+
version = "0.4.31"
|
|
82
76
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
83
|
-
checksum = "
|
|
77
|
+
checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38"
|
|
84
78
|
dependencies = [
|
|
85
|
-
"android-tzdata",
|
|
86
79
|
"num-traits",
|
|
87
80
|
]
|
|
88
81
|
|
|
89
82
|
[[package]]
|
|
90
83
|
name = "deranged"
|
|
91
|
-
version = "0.3.
|
|
84
|
+
version = "0.3.9"
|
|
92
85
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
93
|
-
checksum = "
|
|
86
|
+
checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3"
|
|
87
|
+
dependencies = [
|
|
88
|
+
"powerfmt",
|
|
89
|
+
]
|
|
94
90
|
|
|
95
91
|
[[package]]
|
|
96
92
|
name = "enum-iterator"
|
|
@@ -109,7 +105,7 @@ checksum = "eecf8589574ce9b895052fa12d69af7a233f99e6107f5cb8dd1044f2a17bfdcb"
|
|
|
109
105
|
dependencies = [
|
|
110
106
|
"proc-macro2",
|
|
111
107
|
"quote",
|
|
112
|
-
"syn 2.0.
|
|
108
|
+
"syn 2.0.38",
|
|
113
109
|
]
|
|
114
110
|
|
|
115
111
|
[[package]]
|
|
@@ -120,7 +116,7 @@ checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0"
|
|
|
120
116
|
dependencies = [
|
|
121
117
|
"cfg-if 1.0.0",
|
|
122
118
|
"libc",
|
|
123
|
-
"redox_syscall",
|
|
119
|
+
"redox_syscall 0.3.5",
|
|
124
120
|
"windows-sys",
|
|
125
121
|
]
|
|
126
122
|
|
|
@@ -157,6 +153,12 @@ version = "0.12.3"
|
|
|
157
153
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
158
154
|
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
|
|
159
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
|
+
|
|
160
162
|
[[package]]
|
|
161
163
|
name = "indexmap"
|
|
162
164
|
version = "1.9.3"
|
|
@@ -169,9 +171,9 @@ dependencies = [
|
|
|
169
171
|
|
|
170
172
|
[[package]]
|
|
171
173
|
name = "indoc"
|
|
172
|
-
version = "
|
|
174
|
+
version = "2.0.4"
|
|
173
175
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
174
|
-
checksum = "
|
|
176
|
+
checksum = "1e186cfbae8084e513daff4240b4797e342f988cecda4fb6c939150f96315fd8"
|
|
175
177
|
|
|
176
178
|
[[package]]
|
|
177
179
|
name = "itoa"
|
|
@@ -187,15 +189,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646"
|
|
|
187
189
|
|
|
188
190
|
[[package]]
|
|
189
191
|
name = "libc"
|
|
190
|
-
version = "0.2.
|
|
192
|
+
version = "0.2.149"
|
|
191
193
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
192
|
-
checksum = "
|
|
194
|
+
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
|
|
193
195
|
|
|
194
196
|
[[package]]
|
|
195
197
|
name = "lock_api"
|
|
196
|
-
version = "0.4.
|
|
198
|
+
version = "0.4.11"
|
|
197
199
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
198
|
-
checksum = "
|
|
200
|
+
checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45"
|
|
199
201
|
dependencies = [
|
|
200
202
|
"autocfg",
|
|
201
203
|
"scopeguard",
|
|
@@ -256,9 +258,9 @@ dependencies = [
|
|
|
256
258
|
|
|
257
259
|
[[package]]
|
|
258
260
|
name = "memchr"
|
|
259
|
-
version = "2.
|
|
261
|
+
version = "2.6.4"
|
|
260
262
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
261
|
-
checksum = "
|
|
263
|
+
checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167"
|
|
262
264
|
|
|
263
265
|
[[package]]
|
|
264
266
|
name = "memoffset"
|
|
@@ -271,9 +273,9 @@ dependencies = [
|
|
|
271
273
|
|
|
272
274
|
[[package]]
|
|
273
275
|
name = "num-traits"
|
|
274
|
-
version = "0.2.
|
|
276
|
+
version = "0.2.17"
|
|
275
277
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
276
|
-
checksum = "
|
|
278
|
+
checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c"
|
|
277
279
|
dependencies = [
|
|
278
280
|
"autocfg",
|
|
279
281
|
]
|
|
@@ -306,17 +308,23 @@ dependencies = [
|
|
|
306
308
|
|
|
307
309
|
[[package]]
|
|
308
310
|
name = "parking_lot_core"
|
|
309
|
-
version = "0.9.
|
|
311
|
+
version = "0.9.9"
|
|
310
312
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
311
|
-
checksum = "
|
|
313
|
+
checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e"
|
|
312
314
|
dependencies = [
|
|
313
315
|
"cfg-if 1.0.0",
|
|
314
316
|
"libc",
|
|
315
|
-
"redox_syscall",
|
|
317
|
+
"redox_syscall 0.4.1",
|
|
316
318
|
"smallvec",
|
|
317
319
|
"windows-targets",
|
|
318
320
|
]
|
|
319
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
|
+
|
|
320
328
|
[[package]]
|
|
321
329
|
name = "proc-macro-error"
|
|
322
330
|
version = "1.0.4"
|
|
@@ -343,9 +351,9 @@ dependencies = [
|
|
|
343
351
|
|
|
344
352
|
[[package]]
|
|
345
353
|
name = "proc-macro2"
|
|
346
|
-
version = "1.0.
|
|
354
|
+
version = "1.0.69"
|
|
347
355
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
348
|
-
checksum = "
|
|
356
|
+
checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da"
|
|
349
357
|
dependencies = [
|
|
350
358
|
"unicode-ident",
|
|
351
359
|
]
|
|
@@ -365,7 +373,7 @@ dependencies = [
|
|
|
365
373
|
|
|
366
374
|
[[package]]
|
|
367
375
|
name = "py-promql-parser"
|
|
368
|
-
version = "0.3.
|
|
376
|
+
version = "0.3.2"
|
|
369
377
|
dependencies = [
|
|
370
378
|
"chrono",
|
|
371
379
|
"promql-parser",
|
|
@@ -374,9 +382,9 @@ dependencies = [
|
|
|
374
382
|
|
|
375
383
|
[[package]]
|
|
376
384
|
name = "pyo3"
|
|
377
|
-
version = "0.
|
|
385
|
+
version = "0.20.0"
|
|
378
386
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
379
|
-
checksum = "
|
|
387
|
+
checksum = "04e8453b658fe480c3e70c8ed4e3d3ec33eb74988bd186561b0cc66b85c3bc4b"
|
|
380
388
|
dependencies = [
|
|
381
389
|
"cfg-if 1.0.0",
|
|
382
390
|
"chrono",
|
|
@@ -392,9 +400,9 @@ dependencies = [
|
|
|
392
400
|
|
|
393
401
|
[[package]]
|
|
394
402
|
name = "pyo3-build-config"
|
|
395
|
-
version = "0.
|
|
403
|
+
version = "0.20.0"
|
|
396
404
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
397
|
-
checksum = "
|
|
405
|
+
checksum = "a96fe70b176a89cff78f2fa7b3c930081e163d5379b4dcdf993e3ae29ca662e5"
|
|
398
406
|
dependencies = [
|
|
399
407
|
"once_cell",
|
|
400
408
|
"target-lexicon",
|
|
@@ -402,9 +410,9 @@ dependencies = [
|
|
|
402
410
|
|
|
403
411
|
[[package]]
|
|
404
412
|
name = "pyo3-ffi"
|
|
405
|
-
version = "0.
|
|
413
|
+
version = "0.20.0"
|
|
406
414
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
407
|
-
checksum = "
|
|
415
|
+
checksum = "214929900fd25e6604661ed9cf349727c8920d47deff196c4e28165a6ef2a96b"
|
|
408
416
|
dependencies = [
|
|
409
417
|
"libc",
|
|
410
418
|
"pyo3-build-config",
|
|
@@ -412,32 +420,33 @@ dependencies = [
|
|
|
412
420
|
|
|
413
421
|
[[package]]
|
|
414
422
|
name = "pyo3-macros"
|
|
415
|
-
version = "0.
|
|
423
|
+
version = "0.20.0"
|
|
416
424
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
417
|
-
checksum = "
|
|
425
|
+
checksum = "dac53072f717aa1bfa4db832b39de8c875b7c7af4f4a6fe93cdbf9264cf8383b"
|
|
418
426
|
dependencies = [
|
|
419
427
|
"proc-macro2",
|
|
420
428
|
"pyo3-macros-backend",
|
|
421
429
|
"quote",
|
|
422
|
-
"syn
|
|
430
|
+
"syn 2.0.38",
|
|
423
431
|
]
|
|
424
432
|
|
|
425
433
|
[[package]]
|
|
426
434
|
name = "pyo3-macros-backend"
|
|
427
|
-
version = "0.
|
|
435
|
+
version = "0.20.0"
|
|
428
436
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
429
|
-
checksum = "
|
|
437
|
+
checksum = "7774b5a8282bd4f25f803b1f0d945120be959a36c72e08e7cd031c792fdfd424"
|
|
430
438
|
dependencies = [
|
|
439
|
+
"heck",
|
|
431
440
|
"proc-macro2",
|
|
432
441
|
"quote",
|
|
433
|
-
"syn
|
|
442
|
+
"syn 2.0.38",
|
|
434
443
|
]
|
|
435
444
|
|
|
436
445
|
[[package]]
|
|
437
446
|
name = "quote"
|
|
438
|
-
version = "1.0.
|
|
447
|
+
version = "1.0.33"
|
|
439
448
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
440
|
-
checksum = "
|
|
449
|
+
checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae"
|
|
441
450
|
dependencies = [
|
|
442
451
|
"proc-macro2",
|
|
443
452
|
]
|
|
@@ -451,11 +460,20 @@ dependencies = [
|
|
|
451
460
|
"bitflags",
|
|
452
461
|
]
|
|
453
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
|
+
|
|
454
472
|
[[package]]
|
|
455
473
|
name = "regex"
|
|
456
|
-
version = "1.
|
|
474
|
+
version = "1.10.2"
|
|
457
475
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
458
|
-
checksum = "
|
|
476
|
+
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
|
|
459
477
|
dependencies = [
|
|
460
478
|
"aho-corasick",
|
|
461
479
|
"memchr",
|
|
@@ -465,9 +483,9 @@ dependencies = [
|
|
|
465
483
|
|
|
466
484
|
[[package]]
|
|
467
485
|
name = "regex-automata"
|
|
468
|
-
version = "0.3
|
|
486
|
+
version = "0.4.3"
|
|
469
487
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
470
|
-
checksum = "
|
|
488
|
+
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
|
|
471
489
|
dependencies = [
|
|
472
490
|
"aho-corasick",
|
|
473
491
|
"memchr",
|
|
@@ -476,9 +494,9 @@ dependencies = [
|
|
|
476
494
|
|
|
477
495
|
[[package]]
|
|
478
496
|
name = "regex-syntax"
|
|
479
|
-
version = "0.
|
|
497
|
+
version = "0.8.2"
|
|
480
498
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
481
|
-
checksum = "
|
|
499
|
+
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
|
|
482
500
|
|
|
483
501
|
[[package]]
|
|
484
502
|
name = "rustc_version"
|
|
@@ -503,35 +521,35 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49"
|
|
|
503
521
|
|
|
504
522
|
[[package]]
|
|
505
523
|
name = "semver"
|
|
506
|
-
version = "1.0.
|
|
524
|
+
version = "1.0.20"
|
|
507
525
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
508
|
-
checksum = "
|
|
526
|
+
checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090"
|
|
509
527
|
|
|
510
528
|
[[package]]
|
|
511
529
|
name = "serde"
|
|
512
|
-
version = "1.0.
|
|
530
|
+
version = "1.0.190"
|
|
513
531
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
514
|
-
checksum = "
|
|
532
|
+
checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7"
|
|
515
533
|
dependencies = [
|
|
516
534
|
"serde_derive",
|
|
517
535
|
]
|
|
518
536
|
|
|
519
537
|
[[package]]
|
|
520
538
|
name = "serde_derive"
|
|
521
|
-
version = "1.0.
|
|
539
|
+
version = "1.0.190"
|
|
522
540
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
523
|
-
checksum = "
|
|
541
|
+
checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3"
|
|
524
542
|
dependencies = [
|
|
525
543
|
"proc-macro2",
|
|
526
544
|
"quote",
|
|
527
|
-
"syn 2.0.
|
|
545
|
+
"syn 2.0.38",
|
|
528
546
|
]
|
|
529
547
|
|
|
530
548
|
[[package]]
|
|
531
549
|
name = "smallvec"
|
|
532
|
-
version = "1.11.
|
|
550
|
+
version = "1.11.1"
|
|
533
551
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
534
|
-
checksum = "
|
|
552
|
+
checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a"
|
|
535
553
|
|
|
536
554
|
[[package]]
|
|
537
555
|
name = "sparsevec"
|
|
@@ -564,9 +582,9 @@ dependencies = [
|
|
|
564
582
|
|
|
565
583
|
[[package]]
|
|
566
584
|
name = "syn"
|
|
567
|
-
version = "2.0.
|
|
585
|
+
version = "2.0.38"
|
|
568
586
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
569
|
-
checksum = "
|
|
587
|
+
checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b"
|
|
570
588
|
dependencies = [
|
|
571
589
|
"proc-macro2",
|
|
572
590
|
"quote",
|
|
@@ -575,38 +593,39 @@ dependencies = [
|
|
|
575
593
|
|
|
576
594
|
[[package]]
|
|
577
595
|
name = "target-lexicon"
|
|
578
|
-
version = "0.12.
|
|
596
|
+
version = "0.12.12"
|
|
579
597
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
580
|
-
checksum = "
|
|
598
|
+
checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a"
|
|
581
599
|
|
|
582
600
|
[[package]]
|
|
583
601
|
name = "thiserror"
|
|
584
|
-
version = "1.0.
|
|
602
|
+
version = "1.0.50"
|
|
585
603
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
586
|
-
checksum = "
|
|
604
|
+
checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2"
|
|
587
605
|
dependencies = [
|
|
588
606
|
"thiserror-impl",
|
|
589
607
|
]
|
|
590
608
|
|
|
591
609
|
[[package]]
|
|
592
610
|
name = "thiserror-impl"
|
|
593
|
-
version = "1.0.
|
|
611
|
+
version = "1.0.50"
|
|
594
612
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
595
|
-
checksum = "
|
|
613
|
+
checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8"
|
|
596
614
|
dependencies = [
|
|
597
615
|
"proc-macro2",
|
|
598
616
|
"quote",
|
|
599
|
-
"syn 2.0.
|
|
617
|
+
"syn 2.0.38",
|
|
600
618
|
]
|
|
601
619
|
|
|
602
620
|
[[package]]
|
|
603
621
|
name = "time"
|
|
604
|
-
version = "0.3.
|
|
622
|
+
version = "0.3.30"
|
|
605
623
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
606
|
-
checksum = "
|
|
624
|
+
checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5"
|
|
607
625
|
dependencies = [
|
|
608
626
|
"deranged",
|
|
609
627
|
"itoa",
|
|
628
|
+
"powerfmt",
|
|
610
629
|
"serde",
|
|
611
630
|
"time-core",
|
|
612
631
|
"time-macros",
|
|
@@ -614,15 +633,15 @@ dependencies = [
|
|
|
614
633
|
|
|
615
634
|
[[package]]
|
|
616
635
|
name = "time-core"
|
|
617
|
-
version = "0.1.
|
|
636
|
+
version = "0.1.2"
|
|
618
637
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
619
|
-
checksum = "
|
|
638
|
+
checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3"
|
|
620
639
|
|
|
621
640
|
[[package]]
|
|
622
641
|
name = "time-macros"
|
|
623
|
-
version = "0.2.
|
|
642
|
+
version = "0.2.15"
|
|
624
643
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
625
|
-
checksum = "
|
|
644
|
+
checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20"
|
|
626
645
|
dependencies = [
|
|
627
646
|
"time-core",
|
|
628
647
|
]
|
|
@@ -638,21 +657,21 @@ dependencies = [
|
|
|
638
657
|
|
|
639
658
|
[[package]]
|
|
640
659
|
name = "unicode-ident"
|
|
641
|
-
version = "1.0.
|
|
660
|
+
version = "1.0.12"
|
|
642
661
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
643
|
-
checksum = "
|
|
662
|
+
checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b"
|
|
644
663
|
|
|
645
664
|
[[package]]
|
|
646
665
|
name = "unicode-width"
|
|
647
|
-
version = "0.1.
|
|
666
|
+
version = "0.1.11"
|
|
648
667
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
649
|
-
checksum = "
|
|
668
|
+
checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85"
|
|
650
669
|
|
|
651
670
|
[[package]]
|
|
652
671
|
name = "unindent"
|
|
653
|
-
version = "0.
|
|
672
|
+
version = "0.2.3"
|
|
654
673
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
655
|
-
checksum = "
|
|
674
|
+
checksum = "c7de7d73e1754487cb58364ee906a499937a0dfabd86bcb980fa99ec8c8fa2ce"
|
|
656
675
|
|
|
657
676
|
[[package]]
|
|
658
677
|
name = "vergen"
|
|
@@ -697,9 +716,9 @@ dependencies = [
|
|
|
697
716
|
|
|
698
717
|
[[package]]
|
|
699
718
|
name = "windows-targets"
|
|
700
|
-
version = "0.48.
|
|
719
|
+
version = "0.48.5"
|
|
701
720
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
702
|
-
checksum = "
|
|
721
|
+
checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c"
|
|
703
722
|
dependencies = [
|
|
704
723
|
"windows_aarch64_gnullvm",
|
|
705
724
|
"windows_aarch64_msvc",
|
|
@@ -712,42 +731,42 @@ dependencies = [
|
|
|
712
731
|
|
|
713
732
|
[[package]]
|
|
714
733
|
name = "windows_aarch64_gnullvm"
|
|
715
|
-
version = "0.48.
|
|
734
|
+
version = "0.48.5"
|
|
716
735
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
717
|
-
checksum = "
|
|
736
|
+
checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8"
|
|
718
737
|
|
|
719
738
|
[[package]]
|
|
720
739
|
name = "windows_aarch64_msvc"
|
|
721
|
-
version = "0.48.
|
|
740
|
+
version = "0.48.5"
|
|
722
741
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
723
|
-
checksum = "
|
|
742
|
+
checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc"
|
|
724
743
|
|
|
725
744
|
[[package]]
|
|
726
745
|
name = "windows_i686_gnu"
|
|
727
|
-
version = "0.48.
|
|
746
|
+
version = "0.48.5"
|
|
728
747
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
729
|
-
checksum = "
|
|
748
|
+
checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e"
|
|
730
749
|
|
|
731
750
|
[[package]]
|
|
732
751
|
name = "windows_i686_msvc"
|
|
733
|
-
version = "0.48.
|
|
752
|
+
version = "0.48.5"
|
|
734
753
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
735
|
-
checksum = "
|
|
754
|
+
checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406"
|
|
736
755
|
|
|
737
756
|
[[package]]
|
|
738
757
|
name = "windows_x86_64_gnu"
|
|
739
|
-
version = "0.48.
|
|
758
|
+
version = "0.48.5"
|
|
740
759
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
741
|
-
checksum = "
|
|
760
|
+
checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e"
|
|
742
761
|
|
|
743
762
|
[[package]]
|
|
744
763
|
name = "windows_x86_64_gnullvm"
|
|
745
|
-
version = "0.48.
|
|
764
|
+
version = "0.48.5"
|
|
746
765
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
747
|
-
checksum = "
|
|
766
|
+
checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc"
|
|
748
767
|
|
|
749
768
|
[[package]]
|
|
750
769
|
name = "windows_x86_64_msvc"
|
|
751
|
-
version = "0.48.
|
|
770
|
+
version = "0.48.5"
|
|
752
771
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
753
|
-
checksum = "
|
|
772
|
+
checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538"
|
|
@@ -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"] }
|
|
@@ -110,6 +110,13 @@ impl From<TokenType> for PyTokenType {
|
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
+
#[pymethods]
|
|
114
|
+
impl PyTokenType {
|
|
115
|
+
fn __str__(&self) -> String {
|
|
116
|
+
format!("{}", self.r#type)
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
113
120
|
#[pyclass(name = "AggModifier", module = "promql_parser")]
|
|
114
121
|
#[derive(Debug, Clone)]
|
|
115
122
|
pub struct PyAggModifier {
|
|
@@ -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
|