1.9.0
Highlights
New optional
use_iterative_json
parameter inexecute_mdx_dataframe
/execute_view_dataframe
functions #646, #612
This new feature allows TM1py to use iterative JSON parsing.
When use_iterative_json
is True
TM1py requires a significantly smaller memory footprint (down to ~ 20% of the original value) at an almost negligible cost of performance (single percentage digit):
from TM1py import TM1Service
with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:
df = tm1.cells.execute_view_dataframe(cube_name="Sales", view_name="Very Large View", private=False,
use_iterative_json=True)
This is a handy feature when dealing with large or very large data volumes (1M to 10M cells) in an environment with limited RAM.
New
skip_non_updateable
argument inwrite
/write_dataframe
functions #657
This optional argument to the write
/write_dataframe
functions asks TM1py to filter out cells that can not be updated before attempting to write. If not used, TM1py will fail with an error when attempting to write to rule-derived or consolidated cells.
from TM1py import TM1Service
with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:
cells = {
('Belgium', 'Revenue', '2022', 'Apr', 'Revenue'): 10_000,
('Belgium', 'Revenue', '2022', 'May', 'Revenue'): 15_000,
('Belgium', 'Revenue', '2022', 'Jun', 'Revenue'): 20_000,
('Belgium', 'Revenue', '2022', 'Q1', 'Revenue'): 45_000,
}
tm1.cells.write("Sales", cells, skip_non_updateable=True)
This is a useful feature, as it saves the TM1py user from verifying the validity of the cell updates yourself when not working with flawless data sources.
Only errors w.r.t. updatability are suppressed! Attempts, for instance, to write to not existing elements will still raise errors.
New
search
functions to search through cubes, processes, and chores #660, #663, #665
from TM1py import TM1Service
with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:
processes = tm1.processes.search_string_in_code(search_string="Sales")
from TM1py import TM1Service
with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:
processes = tm1.processes.search_string_in_name(name_contains="Sales")
from TM1py import TM1Service
with TM1Service(
base_url="https://localhost:12354",
user="admin",
password="apple") as tm1:
cubes = tm1.cubes.search_for_dimension(dimension_name="Product", skip_control_cubes=True)
New Features
- add
write to_message_log_function
#621 - allow
skip_zeros
inexecute_mdx_values
function #659 - use python built-in csv module to create csv strings in
execute_mdx_csv
function #678 - new
rename
function inApplicationService
#682 - support
compact_json
in someexecute_mdx_
functions #650
Improvements and Bugfixes
get_last_message_from_processerrorlog
to return text ac0d72f- raise exception when session creation fails a42753e
- don't raise error if cellset is already deleted 3246391
- improve
execute_set_mdx
function 61fe2ea - add
update_or_create
function for document from file 7f94f71 - drop obsolete arguments in
TM1Service
constructor #652 - support attribute type change #664
- fix
get_values
function issue to work with alternate hierarchies seamlessly #680 - improve handling of alternate hierarchies in
write
function #679 - optional
measure_dimension_elements
dictionary argument towrite
andwrite_dataframe
function to improve performance b21ac47
Acknowledgments
Big thanks to @rkvinoth, @jrobinsonAG, @gbryant-dev, @raeldor, @adscheevel, @jordanjeremy for contributing code to this release, and many others for reporting bugs and requesting new features.
How to upgrade TM1py
To upgrade TM1py, just use the following command:
pip install TM1py --upgrade