microsoft / vivainsights-py

Python package for Analyzing and Visualizing data from Viva Insights
https://microsoft.github.io/vivainsights-py/
Other
14 stars 2 forks source link

Error when setting `hrvar = None` for some functions #28

Closed martinctc closed 1 month ago

martinctc commented 2 months ago

In some functions, hrvar=None is not handled properly. I mean if we want to run the analysis on the total instead of splitting by an HR attribute, we can supply None in hrvar. For example: in the functions create_line, create_bar , create_boxplot, it is not handled and it will throw error.

plot_line = vi.create_line(data=pq_data, metric='Emails_sent',hrvar=None, mingroup=5, return_type='plot')

f = vi.create_boxplot(data, metric = "Collaboration_hours", hrvar = None, return_type = "plot")

g = vi.create_bar(pq_data, metric = "Collaboration_hours", hrvar = None)

Thank you @sachinstl for flagging this issue.