py_calc

command
v1.1.23 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: MIT Imports: 8 Imported by: 0

README

py_calc integration test

Created using Ubuntu WSL. Other Linux flavors and MacOS may require edits.

Daemon/Toolbelt environment configuration file capi*.json custom_processors.py_calc.python_interpreter_path setting assumes 'python' symbolic link points to Python3 interpreter (min Python 3.10)

User-supplied formulas are expected to reside in test/data/cfg/py_calc/py directory.

Workflow

The diagram generated with

go run capitoolbelt.go validate_script -script_file=../../../test/data/cfg/py_calc_quicktest/script.json -params_file=../../../test/data/cfg/py_calc_quicktest/script_params.json -detail=idx

drawing

What's tested:

  • table_custom_tfm_table custom processor py_calc with writer using values from both reader (for example, r.shipping_limit_date) and custom processor (for example, p.taxed_value); please note: p.* datatype, like decimal2 of p.taxed_value, is used by writer only, do not expect this datatype when using this field in your Python code
  • file_tablefile_table reading from multiple files
  • table_file with top/limit/order
  • table_file using file-per-batch configuration (see {batch_idx} parameter)
  • table_table processor that, using Capillaries Go funtions and arithmetic operations, implements a subset (no weekday math) of calculations provided by py_calc processor above

How to test

See integration tests section for generic instructions on how to run integration tests.

User-supplied formulas

There are two files in test/data/cfg/py_calc_quicktest/py directory: one contains Python functions called by Capillaries py_calc processor, another file is a user-provided set of tests for those functions (yes, user-provided code can/should be tested too).

Possible edits

References:

Data model design: Brazilian E-Commerce public dataset https://www.kaggle.com/datasets/olistbr/brazilian-ecommerce

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL