1.8.0
Highlights
- Support MDX properties in
execute_mdx_dataframe
.
This allows to query data and attribute data with a single query into one shared data frame.
from TM1py import TM1Service
with TM1Service(address="", port=12354, user="admin", password="apple", ssl=True) as tm1:
mdx = """
SELECT
{Tm1SubsetAll([Region])} PROPERTIES [Region].[Currency] ON COLUMNS,
{Tm1SubsetAll([Year])} ON ROWS
FROM [Sales]
"""
data = tm1.cells.execute_mdx_dataframe(mdx, include_attributes=True)
Year | Region | Currency | Value | |
---|---|---|---|---|
0 | 2021 | US | USD | 18 |
1 | 2021 | UK | GBP | 4 |
write_async
andwrite_async_dataframe
functions withmax_workers
argument.
This is essentially an easy way to speed up TM1 writeback through parallelization.
from TM1py import TM1Service
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
cells = {
('e1', 'e1'): 1,
('e1', 'e2'): 2,
('e2', 'e1'): 3,
('e2', 'e2'): 4,
('e3', 'e1'): 5,
('e3', 'e2'): 6,
}
tm1.cells.write_async(cube_name="c1", cells=cells, slice_size=1, max_workers=6)
from pandas import DataFrame
from TM1py import TM1Service
with TM1Service(address="", port=12354, ssl=True, user="admin", password="apple") as tm1:
data = DataFrame({
'd1': ['e1', 'e1', 'e2', 'e2', 'e3', 'e3'],
'd2': ['e1', 'e2', 'e1', 'e2', 'e1', 'e2'],
'value': [1, 2, 3, 4, 5, 6],
})
tm1.cells.write_dataframe_async(cube_name="c1", data=data, slice_size_of_dataframe=1, max_workers=6)
-
TM1 git support #447
TM1py now allows you to manage the TM1 git repository. You can manage the TM1 database with git and TM1py. -
New authentication mode based on
cam_passport
. Can be used from Jupyter within Cognos Analytics.
from ca_data_connector.ca_lib import OnPremSession
session = OnPremSession()
session.initialize()
passport = session.get_cookies()['cam_passport']
with TM1Service(address=address, port=port, ssl=ssl, cam_passport=passport) as tm1:
print(tm1.server.get_server_name())
New Features
- AuditLog queries 3771dad
- Changes to
tm1.power_bi.execute_mdx
function to provide data to PBI in the most friendly way #476 - Improvement on PowerBI dimension retrieval function to fetch attribute for a parent instead of parent element name #478
- Support
MDX PROPERTIES
inexecute_mdx_dataframe
#470 - Introduce a new
cancel_at_timeout
argument to abort TM1 operation once thetimeout
is reached - Support process debugging a83da11
- New arguments on
execute_mdx
,execute_view
:skip_cell_properties
,element_unique_names
to control shape of response dictionary f751edf, 6d9e520 - TM1 git support #447
- New
write_dataframe_async
function 94081eb - New
write_async
function 3969c1d - Create, read, update, delete servers on admin host #296
- New
re_authenticate
function in TM1Service 2028d3d - Better delta log requests aeed032
- Allow login with
cam_passport
f070c06
Fixes
- Never attempt to delete leaves hierarchy a0aa152
- Make install with pandas work with zsh c458e40
- Fix encoding of ui-data property 6438309
- Fix deactivate / activate chore #515
- Accept float as
timeout
2d0c555 - Fix is_admin property in User class d9ed1b2
- Fix documentation on readthedocs
- Remove linebreaks when writing with ti #568
- Include empty strings suppression in
extract_cellset_raw
01eb4a7 - Allow parameters on unbound processes 144db38
- Improve
kwargs
delegation through call stack ee70f54 - Allow
WITH MEMBERS
combined withinclude_attributes=True
inexecute_mdx_dataframe
function #593 - Allow
WITH MEMBERS
combined withdisplay_attribute=True
inexecute_mdx_dataframe_shaped
function #593 - Skip sandbox dimension in
cubes.get
#595
Acknowledgments
Big thanks to @lapstue, @kaleming, @beckyconning, @macsir, @jrobinsonAG, @tomasfelcman, @cwffonseca for contributing code to this release, and many others for reporting bugs and requesting features.
How to upgrade TM1py
To upgrade TM1py, just use the following command:
pip install TM1py --upgrade