planar 0.10.0__py3-none-any.whl → 0.12.0__py3-none-any.whl

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 (73) hide show
  1. planar/app.py +26 -6
  2. planar/cli.py +26 -0
  3. planar/data/__init__.py +1 -0
  4. planar/data/config.py +12 -1
  5. planar/data/connection.py +89 -4
  6. planar/data/dataset.py +13 -7
  7. planar/data/utils.py +145 -25
  8. planar/db/alembic/env.py +68 -57
  9. planar/db/alembic.ini +1 -1
  10. planar/files/storage/config.py +7 -1
  11. planar/routers/dataset_router.py +5 -1
  12. planar/routers/info.py +79 -36
  13. planar/scaffold_templates/pyproject.toml.j2 +1 -1
  14. planar/testing/fixtures.py +7 -4
  15. planar/testing/planar_test_client.py +8 -0
  16. planar/version.py +27 -0
  17. planar-0.12.0.dist-info/METADATA +202 -0
  18. {planar-0.10.0.dist-info → planar-0.12.0.dist-info}/RECORD +20 -71
  19. planar/ai/test_agent_serialization.py +0 -229
  20. planar/ai/test_agent_tool_step_display.py +0 -78
  21. planar/data/test_dataset.py +0 -358
  22. planar/files/storage/test_azure_blob.py +0 -435
  23. planar/files/storage/test_local_directory.py +0 -162
  24. planar/files/storage/test_s3.py +0 -299
  25. planar/files/test_files.py +0 -282
  26. planar/human/test_human.py +0 -385
  27. planar/logging/test_formatter.py +0 -327
  28. planar/modeling/mixins/test_auditable.py +0 -97
  29. planar/modeling/mixins/test_timestamp.py +0 -134
  30. planar/modeling/mixins/test_uuid_primary_key.py +0 -52
  31. planar/routers/test_agents_router.py +0 -174
  32. planar/routers/test_dataset_router.py +0 -429
  33. planar/routers/test_files_router.py +0 -49
  34. planar/routers/test_object_config_router.py +0 -367
  35. planar/routers/test_routes_security.py +0 -168
  36. planar/routers/test_rule_router.py +0 -470
  37. planar/routers/test_workflow_router.py +0 -564
  38. planar/rules/test_data/account_dormancy_management.json +0 -223
  39. planar/rules/test_data/airline_loyalty_points_calculator.json +0 -262
  40. planar/rules/test_data/applicant_risk_assessment.json +0 -435
  41. planar/rules/test_data/booking_fraud_detection.json +0 -407
  42. planar/rules/test_data/cellular_data_rollover_system.json +0 -258
  43. planar/rules/test_data/clinical_trial_eligibility_screener.json +0 -437
  44. planar/rules/test_data/customer_lifetime_value.json +0 -143
  45. planar/rules/test_data/import_duties_calculator.json +0 -289
  46. planar/rules/test_data/insurance_prior_authorization.json +0 -443
  47. planar/rules/test_data/online_check_in_eligibility_system.json +0 -254
  48. planar/rules/test_data/order_consolidation_system.json +0 -375
  49. planar/rules/test_data/portfolio_risk_monitor.json +0 -471
  50. planar/rules/test_data/supply_chain_risk.json +0 -253
  51. planar/rules/test_data/warehouse_cross_docking.json +0 -237
  52. planar/rules/test_rules.py +0 -1494
  53. planar/security/tests/test_auth_middleware.py +0 -162
  54. planar/security/tests/test_authorization_context.py +0 -78
  55. planar/security/tests/test_cedar_basics.py +0 -41
  56. planar/security/tests/test_cedar_policies.py +0 -158
  57. planar/security/tests/test_jwt_principal_context.py +0 -179
  58. planar/test_app.py +0 -142
  59. planar/test_cli.py +0 -394
  60. planar/test_config.py +0 -515
  61. planar/test_object_config.py +0 -527
  62. planar/test_object_registry.py +0 -14
  63. planar/test_sqlalchemy.py +0 -193
  64. planar/test_utils.py +0 -105
  65. planar/testing/test_memory_storage.py +0 -143
  66. planar/workflows/test_concurrency_detection.py +0 -120
  67. planar/workflows/test_lock_timeout.py +0 -140
  68. planar/workflows/test_serialization.py +0 -1203
  69. planar/workflows/test_suspend_deserialization.py +0 -231
  70. planar/workflows/test_workflow.py +0 -2005
  71. planar-0.10.0.dist-info/METADATA +0 -323
  72. {planar-0.10.0.dist-info → planar-0.12.0.dist-info}/WHEEL +0 -0
  73. {planar-0.10.0.dist-info → planar-0.12.0.dist-info}/entry_points.txt +0 -0
@@ -1,435 +0,0 @@
1
- {
2
- "nodes": [
3
- {
4
- "type": "inputNode",
5
- "content": {
6
- "schema": ""
7
- },
8
- "id": "input",
9
- "name": "request",
10
- "position": {
11
- "x": 110,
12
- "y": 163.5
13
- }
14
- },
15
- {
16
- "type": "decisionTableNode",
17
- "content": {
18
- "hitPolicy": "first",
19
- "rules": [
20
- {
21
- "_id": "r1-1",
22
- "i1-1": "> 750",
23
- "i1-2": "< 2",
24
- "i1-3": "> 60",
25
- "o1-1": "30"
26
- },
27
- {
28
- "_id": "r1-2",
29
- "i1-1": "[650..750]",
30
- "i1-2": "< 4",
31
- "i1-3": "> 36",
32
- "o1-1": "20"
33
- },
34
- {
35
- "_id": "r1-3",
36
- "i1-1": "[600..650)",
37
- "i1-2": "< 6",
38
- "i1-3": "> 24",
39
- "o1-1": "10"
40
- },
41
- {
42
- "_id": "r1-4",
43
- "i1-1": "",
44
- "i1-2": "",
45
- "i1-3": "",
46
- "o1-1": "0"
47
- }
48
- ],
49
- "inputs": [
50
- {
51
- "id": "i1-1",
52
- "name": "creditScore",
53
- "field": "applicant.creditScore"
54
- },
55
- {
56
- "id": "i1-2",
57
- "name": "latePayments",
58
- "field": "applicant.latePayments"
59
- },
60
- {
61
- "id": "i1-3",
62
- "name": "creditHistoryLength",
63
- "field": "applicant.creditHistoryMonths"
64
- }
65
- ],
66
- "outputs": [
67
- {
68
- "id": "o1-1",
69
- "name": "creditHistoryScore",
70
- "field": "scores.creditHistory"
71
- }
72
- ],
73
- "passThrough": true,
74
- "inputField": null,
75
- "outputPath": null,
76
- "executionMode": "single",
77
- "passThorough": false
78
- },
79
- "id": "scoreCreditHistory",
80
- "name": "scoreCreditHistory",
81
- "position": {
82
- "x": 430,
83
- "y": 163.5
84
- }
85
- },
86
- {
87
- "type": "decisionTableNode",
88
- "content": {
89
- "hitPolicy": "first",
90
- "rules": [
91
- {
92
- "_id": "r2-1",
93
- "i2-1": "> 60",
94
- "i2-2": "'complete'",
95
- "i2-3": "'good'",
96
- "o2-1": "25"
97
- },
98
- {
99
- "_id": "r2-2",
100
- "i2-1": "> 24",
101
- "i2-2": "'complete'",
102
- "i2-3": "'good'",
103
- "o2-1": "20"
104
- },
105
- {
106
- "_id": "r2-3",
107
- "i2-1": "> 12",
108
- "i2-2": "'partial'",
109
- "i2-3": "'fair'",
110
- "o2-1": "15"
111
- },
112
- {
113
- "_id": "r2-4",
114
- "i2-1": "> 6",
115
- "i2-2": "",
116
- "i2-3": "",
117
- "o2-1": "5"
118
- },
119
- {
120
- "_id": "r2-5",
121
- "i2-1": "",
122
- "i2-2": "",
123
- "i2-3": "",
124
- "o2-1": "0"
125
- }
126
- ],
127
- "inputs": [
128
- {
129
- "id": "i2-1",
130
- "name": "employmentLength",
131
- "field": "applicant.employmentMonths"
132
- },
133
- {
134
- "id": "i2-2",
135
- "name": "incomeVerification",
136
- "field": "applicant.incomeVerification"
137
- },
138
- {
139
- "id": "i2-3",
140
- "name": "bankAccountStanding",
141
- "field": "applicant.bankAccountStanding"
142
- }
143
- ],
144
- "outputs": [
145
- {
146
- "id": "o2-1",
147
- "name": "incomeStabilityScore",
148
- "field": "scores.incomeStability"
149
- }
150
- ],
151
- "passThrough": true,
152
- "inputField": null,
153
- "outputPath": null,
154
- "executionMode": "single"
155
- },
156
- "id": "scoreIncomeStability",
157
- "name": "scoreIncomeStability",
158
- "position": {
159
- "x": 750,
160
- "y": 163.5
161
- }
162
- },
163
- {
164
- "type": "decisionTableNode",
165
- "content": {
166
- "hitPolicy": "first",
167
- "rules": [
168
- {
169
- "_id": "r3-1",
170
- "i3-1": "< 0.2",
171
- "i3-2": "< 2",
172
- "o3-1": "25"
173
- },
174
- {
175
- "_id": "r3-2",
176
- "i3-1": "< 0.4",
177
- "i3-2": "< 3",
178
- "o3-1": "15"
179
- },
180
- {
181
- "_id": "r3-3",
182
- "i3-1": "< 0.6",
183
- "i3-2": "< 5",
184
- "o3-1": "5"
185
- },
186
- {
187
- "_id": "r3-4",
188
- "i3-1": "",
189
- "i3-2": "",
190
- "o3-1": "0"
191
- }
192
- ],
193
- "inputs": [
194
- {
195
- "id": "i3-1",
196
- "name": "debtToIncomeRatio",
197
- "field": "applicant.debtToIncomeRatio"
198
- },
199
- {
200
- "id": "i3-2",
201
- "name": "outstandingLoans",
202
- "field": "applicant.outstandingLoans"
203
- }
204
- ],
205
- "outputs": [
206
- {
207
- "id": "o3-1",
208
- "name": "debtToIncomeScore",
209
- "field": "scores.debtToIncome"
210
- }
211
- ],
212
- "passThrough": true,
213
- "inputField": null,
214
- "outputPath": null,
215
- "executionMode": "single"
216
- },
217
- "id": "scoreDebtToIncome",
218
- "name": "scoreDebtToIncome",
219
- "position": {
220
- "x": 1070,
221
- "y": 163.5
222
- }
223
- },
224
- {
225
- "type": "expressionNode",
226
- "content": {
227
- "expressions": [
228
- {
229
- "id": "e4-1",
230
- "key": "totalRiskScore",
231
- "value": "scores.creditHistory + scores.incomeStability + scores.debtToIncome"
232
- },
233
- {
234
- "id": "e4-2",
235
- "key": "negativeFactors",
236
- "value": "filter([scores.creditHistory == 0, scores.incomeStability == 0, scores.debtToIncome == 0], # == true)"
237
- },
238
- {
239
- "id": "e4-3",
240
- "key": "negativeFactorsCount",
241
- "value": "len($.negativeFactors)"
242
- }
243
- ],
244
- "passThrough": true,
245
- "inputField": null,
246
- "outputPath": null,
247
- "executionMode": "single"
248
- },
249
- "id": "calculateRiskScore",
250
- "name": "calculateRiskScore",
251
- "position": {
252
- "x": 1390,
253
- "y": 163.5
254
- }
255
- },
256
- {
257
- "type": "switchNode",
258
- "content": {
259
- "hitPolicy": "first",
260
- "statements": [
261
- {
262
- "id": "s1",
263
- "condition": "totalRiskScore >= 60 and negativeFactorsCount == 0",
264
- "isDefault": false
265
- },
266
- {
267
- "id": "s2",
268
- "condition": "totalRiskScore >= 30 or (totalRiskScore >= 20 and negativeFactorsCount < 2)",
269
- "isDefault": false
270
- },
271
- {
272
- "id": "s3",
273
- "condition": "",
274
- "isDefault": true
275
- }
276
- ]
277
- },
278
- "id": "classifyRisk",
279
- "name": "classifyRisk",
280
- "position": {
281
- "x": 1710,
282
- "y": 163.5
283
- }
284
- },
285
- {
286
- "type": "expressionNode",
287
- "content": {
288
- "expressions": [
289
- {
290
- "id": "e6-1",
291
- "key": "riskCategory",
292
- "value": "'low'"
293
- },
294
- {
295
- "id": "e6-2",
296
- "key": "approvalStatus",
297
- "value": "'auto-approved'"
298
- },
299
- {
300
- "id": "e6-3",
301
- "key": "interestRateModifier",
302
- "value": "-0.5"
303
- }
304
- ],
305
- "passThrough": true,
306
- "inputField": null,
307
- "outputPath": null,
308
- "executionMode": "single"
309
- },
310
- "id": "lowRiskAction",
311
- "name": "lowRiskAction",
312
- "position": {
313
- "x": 2030,
314
- "y": 65.5
315
- }
316
- },
317
- {
318
- "type": "expressionNode",
319
- "content": {
320
- "expressions": [
321
- {
322
- "id": "e7-1",
323
- "key": "riskCategory",
324
- "value": "'medium'"
325
- },
326
- {
327
- "id": "e7-2",
328
- "key": "approvalStatus",
329
- "value": "'manual-review'"
330
- },
331
- {
332
- "id": "e7-3",
333
- "key": "interestRateModifier",
334
- "value": "0"
335
- }
336
- ],
337
- "passThrough": true,
338
- "inputField": null,
339
- "outputPath": null,
340
- "executionMode": "single"
341
- },
342
- "id": "mediumRiskAction",
343
- "name": "mediumRiskAction",
344
- "position": {
345
- "x": 2030,
346
- "y": 163.5
347
- }
348
- },
349
- {
350
- "type": "expressionNode",
351
- "content": {
352
- "expressions": [
353
- {
354
- "id": "e8-1",
355
- "key": "riskCategory",
356
- "value": "'high'"
357
- },
358
- {
359
- "id": "e8-2",
360
- "key": "approvalStatus",
361
- "value": "'additional-verification'"
362
- },
363
- {
364
- "id": "e8-3",
365
- "key": "interestRateModifier",
366
- "value": "1.5"
367
- }
368
- ],
369
- "passThrough": true,
370
- "inputField": null,
371
- "outputPath": null,
372
- "executionMode": "single"
373
- },
374
- "id": "highRiskAction",
375
- "name": "highRiskAction",
376
- "position": {
377
- "x": 2030,
378
- "y": 261.5
379
- }
380
- }
381
- ],
382
- "edges": [
383
- {
384
- "id": "e1",
385
- "sourceId": "input",
386
- "targetId": "scoreCreditHistory",
387
- "type": "edge"
388
- },
389
- {
390
- "id": "e2",
391
- "sourceId": "scoreCreditHistory",
392
- "targetId": "scoreIncomeStability",
393
- "type": "edge"
394
- },
395
- {
396
- "id": "e3",
397
- "sourceId": "scoreIncomeStability",
398
- "targetId": "scoreDebtToIncome",
399
- "type": "edge"
400
- },
401
- {
402
- "id": "e4",
403
- "sourceId": "scoreDebtToIncome",
404
- "targetId": "calculateRiskScore",
405
- "type": "edge"
406
- },
407
- {
408
- "id": "e5",
409
- "sourceId": "calculateRiskScore",
410
- "targetId": "classifyRisk",
411
- "type": "edge"
412
- },
413
- {
414
- "id": "e6",
415
- "sourceId": "classifyRisk",
416
- "targetId": "lowRiskAction",
417
- "sourceHandle": "s1",
418
- "type": "edge"
419
- },
420
- {
421
- "id": "e7",
422
- "sourceId": "classifyRisk",
423
- "targetId": "mediumRiskAction",
424
- "sourceHandle": "s2",
425
- "type": "edge"
426
- },
427
- {
428
- "id": "e8",
429
- "sourceId": "classifyRisk",
430
- "targetId": "highRiskAction",
431
- "sourceHandle": "s3",
432
- "type": "edge"
433
- }
434
- ]
435
- }