Highlights
1. Support for TM1 v12
TM1py now works with TM1 v12.
python
with TM1Service(
address="us-east-2.aws.planninganalytics.ibm.com",
api_key="AB4VfG7T8wPM-912uFKeYG5PGh0XbS80MVBAt7SEG6xn",
iam_url="https://iam.cloud.ibm.com/identity/token",
tenant="YA9A2T8BS2ZU",
database="Database") as tm1:
print(tm1.server.get_product_Version())
by rclapp in https://github.com/cubewise-code/tm1py/pull/1000
2. CRUD operations to manage servers on v12
python
with ManageService(domain=domain, root_client=root_client, root_secret=root_secret) as manager:
manager.create_database(instance_name="instance name",
database_name="database_name",
product_version="12.0.0",
number_replicas=1,
cpu_requests="1000m",
cpu_limits="2000m",
memory_limits="2G",
memory_requests="1G",
storage_size="20Gi")
manager.scale_database(instance_name="instance name", database_name="database name", replicas=2)
manager.create_database_backup(instance_name="instance name",
database_name="database name",
backup_set_name="my backup")
by rclapp
3. Asynchronous `execute_mdx` functions
Speed up your MDX executions by assigning more than one worker-thread in TM1.
python
mdx = """
SELECT
{TM1SubsetAll([Big Dimension])} ON ROWS,
{TM1SubsetAll([Small Dimension])} ON COLUMNS
FROM [Big Cube]
"""
with TM1Service(**tm1params) as tm1:
cells = tm1.cells.execute_mdx(
mdx=mdx,
leverage 4 worker threads in TM1 for the extraction
max_workers=4,
parallelization on rows axis
async_axis=1)
by vmitsenko in https://github.com/cubewise-code/tm1py/pull/935 and https://github.com/cubewise-code/tm1py/pull/1030
4. Hierarchy updates from data frames
Create and update TM1 hierarchies directly from pandas dataframes.
Stores | ElementType | Alias:a | City:s | Square Footage:n | level001 | level000 | level001_weight | level000_weight |
|:---------|:--------------|:-----------------|:--------------|-------------------:|:------------|:-----------|------------------:|------------------:|
S151 | Numeric | Boardwalk Games | New York City | 120 | USA | World | 1 | 1 |
S143 | Numeric | Strategy Vault | Zurich | 250 | Switzerland | World | 1 | 1 |
S811 | Numeric | Cardboard Castle | Sydney | 80 | Sydney | World | 1 | 1 |
python
columns = ["Stores", "ElementType", "Alias:a", "City:s", "Square Footage:n", "level001",
"level000", "level001_weight", "level000_weight"]
data = [
['S151', "Numeric", "Boardwalk Games", "New York City", 120, "USA", "World", 1, 1],
['S143', 'Numeric', "Strategy Vault", "Zurich", 250, "Switzerland", "World", 1, 1],
['S811', 'Numeric', "Cardboard Castle", "Sydney", 80, "Sydney", "World", 1, 1],
]
with TM1Service(**tm1params) as tm1:
tm1.hierarchies.update_or_create_hierarchy_from_dataframe(
dimension_name="Stores",
hierarchy_name="Stores",
df=DataFrame(data=data, columns=columns)
)
<img width="552" alt="image" src="https://github.com/cubewise-code/tm1py/assets/15182131/2b098efd-a375-47f1-94f9-4a50a0b0ea49">
by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/944 and https://github.com/cubewise-code/tm1py/pull/1011
New Features, Improvements, and Bugfixes
* Improve `get_elements_dataframe`with optional `use_blob` by MariusWirtz in 908 and https://github.com/cubewise-code/tm1py/pull/1040
* Allow spreading on `write` with `use_blob` & `use_ti` by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/909
* Add `proxies` arg to `TM1Service` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/911
* Show parameters on decorated functions in PyCharm by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/913
* Cater to breaking change in urllib3 2.0 release by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/918
* Fix wrong position brackets in `extract_cellset_raw` by vmitsenko in https://github.com/cubewise-code/tm1py/pull/923
* Add `keep_existing_attributes` to dimension update function to fix 922 by hermie64 in https://github.com/cubewise-code/tm1py/pull/924
* Enforce non-async request on project PUT to fix 872 by nicolasbisurgi in https://github.com/cubewise-code/tm1py/pull/925
* Add `get_edges_under_consolidation` Function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/927, https://github.com/cubewise-code/tm1py/pull/930
* Add method to delete elements by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/939
* Avoid failure on attempt to write empty cellset by rclapp in https://github.com/cubewise-code/tm1py/pull/947
* Delete multiple elements using TI by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/940
* Make JSON parsing for Chore more robust by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/950
* Make JSON parsing for NativeView more robust by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/955
* Remove temp view in `_execute_view_csv_use_blob` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/959
* Added clear view argument to write_through_blob by cubewise-gng in https://github.com/cubewise-code/tm1py/pull/964
* Add `arranged_axes` arg to `execute_view_csv` functions by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/961
* Allow optional weight columns on `get_elements_dataframe` function result by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/975
* Add new methods to expose cell partitioning by rclapp in https://github.com/cubewise-code/tm1py/pull/976
* Allow usage of `get_attribute_of_elements` function with numpy arrays by MBonotto in https://github.com/cubewise-code/tm1py/pull/987
* Add search function `search_error_log_filenames` for Process Error Log Filenames by adscheevel in https://github.com/cubewise-code/tm1py/pull/1004
* Include `clear_view` arg in `write_dataframe` by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1012
* Add `replace_element` function to Hierarchy class by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1014
* Add `update_or_create` function in ElementService.py by yyzz1010 in https://github.com/cubewise-code/tm1py/pull/1018
* Add `allow_empty_alias` argument to `get_elements_dataframe` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1013
* Add `execution_path` property to `Chore` class by wimgielis in https://github.com/cubewise-code/tm1py/pull/1021
* Redesign legacy `require_admin` decorators to more granular `require_data_admin` etc. checks by adscheevel in https://github.com/cubewise-code/tm1py/pull/1016
* New `extract_cellset_axes_raw_async`, `extract_cellset_cell_async` and `extract_cellset_axes_cardinality` by vmitsenko in https://github.com/cubewise-code/tm1py/pull/957
* Add function `clear_with_dataframe` to clear cubes with dataframe https://github.com/cubewise-code/tm1py/issues/1006 by 151N3 in https://github.com/cubewise-code/tm1py/pull/1026, https://github.com/cubewise-code/tm1py/pull/1032
* Add function `get_values` by raeldor in https://github.com/cubewise-code/tm1py/pull/1020
* Fix issue on `restore_from_file` function by MariusWirtz in https://github.com/cubewise-code/tm1py/pull/1039
* Redesign TM1py services architecture by rclapp and adscheevel in https://github.com/cubewise-code/tm1py/pull/1042
* Substite nan attribute values with sensible values in `execute_mdx_dataframe` when `include_attributes` is `True` by Kevin-Dekker in https://github.com/cubewise-code/tm1py/pull/1045
* Add `search_string_in_name` function to search for files in TM1 by adscheevel in https://github.com/cubewise-code/tm1py/pull/1049
Stats
- Contributors: 15
- Commits: 178
- Changed Files: 72
- Added Lines: 7,205
- Deleted Lines: 1,643
How to upgrade TM1py
pip install tm1py --upgrade
New Contributors
* vmitsenko made their first contribution in https://github.com/cubewise-code/tm1py/pull/923
* hermie64 made their first contribution in https://github.com/cubewise-code/tm1py/pull/924
* MBonotto made their first contribution in https://github.com/cubewise-code/tm1py/pull/987
* yyzz1010 made their first contribution in https://github.com/cubewise-code/tm1py/pull/1018
* wimgielis made their first contribution in https://github.com/cubewise-code/tm1py/pull/1021
* 151N3 made their first contribution in https://github.com/cubewise-code/tm1py/pull/1026
**Full Changelog**: https://github.com/cubewise-code/tm1py/compare/1.11.1...2.0