Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tm1.bedrock module to expose bedrock processes conveniently #928

Open
MariusWirtz opened this issue Jun 7, 2023 · 3 comments
Open

tm1.bedrock module to expose bedrock processes conveniently #928

MariusWirtz opened this issue Jun 7, 2023 · 3 comments
Milestone

Comments

@MariusWirtz
Copy link
Collaborator

We could introduce a module to TM1py that offers bedrock process execution most conveniently.

Based on the existing bedrock processes, we could introduce functions to TM1py that map 1 to 1 to the bedrock processes.
Example:

with TM1Service(**tm1_params) as tm1:
    success, status, error_log_file = tm1.bedrock.bedrock_cube_data_clear(
        pStrictErrorHandling=1,
        pCube='Sales',
        pFilter='Year¦ 2022 + 2023 & Scenario¦ Actual + Budget & Organization¦ North America Operations')

This provides two advantages over calling bedrock processes the "normal way":

  • The TI process parameters (e.g., pCube) are 1 to 1 mapped as arguments to the Python function. This helps to code and reduces lookups and errors.
  • TM1py could maintain a collection of JSON files (as part of the repo or in a separate repo) that describe the bedrock process collection and inject bedrock processes that don't already exist in a TM1 model.

I imagine that Bedrock process injection is switched off by default.
It could be passed to the bedrock_cube_data_clear function through an argument like create_if_necessary.

The actual code for the TM1py module could be generated by script based on the bedrock process JSON definitions.

@MariusWirtz MariusWirtz added this to the 2.1 milestone Jan 23, 2024
@onefloid
Copy link
Contributor

Hello Marius,
do you already have an idea how to check if the existing Bedrock processes have a minimum version?

Is there already a solution?
I thought about this and maybe a solution is to introduce a Front Matter (inspired by Jekyll Link) in the TI, where the version of the ti is exposed.

Example:

#Section Prolog
#****Begin: Generated Statements***
#****End: Generated Statements****

#---
# version = 1.1.3
#---

sText = 'IBM Cognos TM1';

Happy to hear if anyone have a other/better solution.

@MariusWirtz
Copy link
Collaborator Author

TBH my first thought was that TM1py uses whatever bedrock version is available in the instance.
Only if bedrock isn't installed at all would TM1py "inject" it. This is would be the least invasive approach I think.

But I do agree that it would be right for bedrock processes to have a kind of "Front Matter" in the prolog.
If this existed, the TM1py bedrock functions could be more intelligent and raise version errors.

@lotsaram
What are your thoughts on the version comments?

@lotsaram
Copy link

lotsaram commented Mar 13, 2024

Is this already covered by the existing comment header present in the prolog of all bedrock processes?

################################################################################################# 
##~~Join the bedrock TM1 community on GitHub https://github.com/cubewise-code/bedrock Ver 4.0~~##
#################################################################################################

Currently however AFAIK the version portion of the header isn't updated with each release. It's frozen at 4.0. But this would be the minimum version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants