Skip to main content
Question

I push data in celonis using data push api (python methods), but column width of some of the is so high that it is showing entire content .is there any way to increase the column with from 80 to 240 in data push api methods

  • November 10, 2023
  • 1 reply
  • 10 views

Forum|alt.badge.img+5
I push data in celonis using data push api (python methods), but column width of some of the is so high that it is showing entire content . is there any way to increase the column with from 80 to 240 in data push api methods

1 reply

mateusz.dudek14
Level 11
Forum|alt.badge.img+11
  • Level 11
  • 102 replies
  • November 10, 2023

Hi,

 

Yes, you'll have to create column_config with values higher than 80, that should work - pleae note that np.vectorize rounds the number, so maybe you want to add +1 to 'fieldLenght' value or multiply it by 1.2 and round up. If it helps upvote and mark as best answer :)

 

Code snippet:

 

#Creating proper column config based on dataframe called 'df'

measurer = np.vectorize(len)

column_setup_df = pd.Series(df.columns).to_frame("columnName")

column_setup_df['columnType'] = 'STRING'

column_setup_df['fieldLenght'] = measurer(df.values.astype(str)).max(axis=0)

column_list = column_setup_df.to_dist('records')

 

#Pushing dataframe 'df' as a table with 'table_name' using created column_config

data_pool.create_table(table_name=table_name, df_or_path=df, if_exists="drop", column_config=column_list)

 

Best Regards,

Mateusz Dudek