-
Notifications
You must be signed in to change notification settings - Fork 115
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
Line Breaks in String Data #568
Comments
something like attributes[(element_name, attribute)] = str(record[attribute]).replace("\n", "").replace("\r", "") |
Hi @ianboltz, Yes. I think TM1py should deal with the line breaks. I wonder if we should by default remove all linebreaks when the I could imagine that in some cases users would prefer a failure over a manipulated text value (no linebreaks) in the cube. Any other opinions on this one? |
I would say maybe we need two things
|
Yeah. We could call it You mean the message log right? |
I think writing to the log when using an unbound TI could be helpful; number of records processed perhaps.
…Sent from my mobile phone
On Jul 9, 2021 9:43 AM, Marius Wirtz ***@***.***> wrote:
Yeah. We could call it keep_line_breaks_in_ti and set the default value to False.
You mean the message log right?
Until now TM1py never writes debug stuff to the TM1 logs. Don't think we should start this now. Either way, we couldn't do it consistently through the TM1py library as it requires admin permissions.
-
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub<#568 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEK7GZUHBZABMDPTHKR7SNDTW34FRANCNFSM5ACKWTQA>.
|
@rclapp do you mean the tm1py script should maintain its own log file and output the number of records it processes or you think tm1py should log that information into TM1's message log? For my tm1py scripts, I always maintain a little log file next to the
For previous implementations, I only wrote to the message log in case of fatal errors that need to be brought to attention. |
My suggestion is that anytime we call TI code (bound or unbound) we should follow best practices. That includes using log out put for useful debug metrics.
…Sent from my mobile phone
On Jul 12, 2021 4:34 AM, Marius Wirtz ***@***.***> wrote:
@rclapp<https://github.com/rclapp> do you mean the tm1py script should maintain its own log file and output the number of records it processes or you think tm1py should log that information into TM1's message log?
For my tm1py scripts, I always maintain a little log file next to the main.py in which I log the execution flow and relevant events to help troubleshoot and spot performance bottlenecks early on. Kinda like below:
2021-04-14 17:03:00,674 - INFO - Starting execution
2021-04-14 17:03:01,694 - INFO - Connected to source TM1 instance: 'Planing Sample' with version: '11.6.00000.14'
2021-04-14 17:03:02,011 - INFO - Successfully retrieved dimension: 'FiscalPeriod' with 50 elements from source
2021-04-14 17:03:02,151 - INFO - Successfully updated dimension: 'FiscalPeriod' in target
2021-04-14 17:03:03,770 - INFO - Successfully cleared cube 'Sales' on target instance
2021-04-14 17:03:05,211 - INFO - Attempting to process 123850 cells in total
2021-04-14 17:04:37,772 - INFO - Processed 123850 cells in total
2021-04-14 17:04:37,905 - INFO - Successfully synchronized data
For previous implementations, I only wrote to the message log in case of fatal errors that need to be brought to attention.
I think the tm1py script events or flow information would be too granular information to bring to the tm1 message log.
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#568 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEK7GZVU6YJUDDGQKT65M4LTXKSFTANCNFSM5ACKWTQA>.
|
Update: The linebreaks only break the write with ti functionality if they are followed by a hashtag ( |
currently linebreaks followed by the hashmark (`#`) break the `write_through_unbound_proecss` function. since turbo integrator doesn't write linebreaks to cells anyways, we may as well remove them from the string. Fixes #568
@rclapp I like this idea. Ideally, we could build something generic that is added at the top and bottom of every unbound process that's being executed by TM1py. Perhaps the logic could be added to the I think it makes sense to control this debugging output through an optional parameter on a TM1py function. |
currently linebreaks followed by the hashmark (`#`) break the `write_through_unbound_proecss` function. since turbo integrator doesn't write linebreaks to cells anyways, we may as well remove them from the string. Fixes #568
currently linebreaks followed by the hashmark (`#`) break the `write_through_unbound_proecss` function. since turbo integrator doesn't write linebreaks to cells anyways, we may as well remove them from the string. Fixes #568
Describe what did you try to do with TM1py
Loaded data using self.tm1.cubes.cells.write(cubename, data, use_ti=True) where the data included strings that contained line breaks.
Describe what's not working the way you expect
The TI build fails as the string data with line breaks is interpreted wrong in the TI. We need to parse any strings for line breaks (or other escape chars) before creating the TI
Version
The text was updated successfully, but these errors were encountered: