vivainsights.check_query¶
This module provides functionality to check a query to ensure that it is suitable for analysis. Prints diagnostic data about the data query to the console, with information such as date range, number of employees, HR attributes identified, etc.
- vivainsights.check_query.check_query(data, return_type='message')[source]¶
Check a query to ensure that it is suitable for analysis.
Prints diagnostic data about the data query to the console, with information such as date range, number of employees, HR attributes identified, etc.
This can be used with any person-level query, such as the standard person query, Ways of Working assessment query, and the hourly collaboration query. When run, this prints diagnostic data to the console.
- Parameters:
data (pandas.DataFrame) –
A person-level query in the form of a pandas DataFrame. This includes: - Standard Person Query - Ways of Working Assessment Query - Hourly Collaboration Query
All person-level queries have a PersonId column and a MetricDate column.
return_type (str, optional) – String specifying what to return. This must be one of the following strings: - “message” (default): prints message to console - “text”: returns string containing the diagnostic message
- Returns:
A different output is returned depending on the value passed to the return_type argument: - “message”: prints message to console and returns None - “text”: returns string containing the diagnostic message
- Return type:
str or None
- Raises:
ValueError – If input is not a DataFrame or if required columns are missing.
Examples
>>> import vivainsights as vi >>> loaded_data = vi.load_pq_data() >>> vi.check_query(loaded_data) >>> >>> # To get the message as text >>> message_text = vi.check_query(loaded_data, return_type="text")