This PR addresses several issues and improvements related to API key handling, session configuration, interactivity checks, and URL handling. Additionally, a refactoring has been performed to enhance code structure and maintainability:
API Key Validation: Previously, the API key was not being validated if the user provided it as a parameter to function. This has been fixed, ensuring that the API key is checked and validated when passed by the user.
Session-specific Configuration: It was previously impossible to configure settings only for the current session without writing them to the configuration file. Now, the configuration values passed during runtime are applied to the current session without being persisted to the config file, unless explicitly specified as configure() param FORCE=TRUE.
Improved is_interactive Check: The is_interactive method previously always returned True. A proper implementation has now been added to accurately determine if the session is interactive (is it terminal, jupiter notebook, google colab etc).
Correct Handling of On-Premise URL: Proper handling for on-premise URLs has been added, ensuring that custom on-premise configurations are correctly processed.
Refactoring and Modularization: The configure function and related methods have been refactored and moved to a separate module to improve code organization and readability.
Unit Tests Update: Unit tests have been updated and moved to reflect the refactoring of the configure module, ensuring comprehensive test coverage and validation of the new structure.
Testing
This PR needs additional testing of configure() function and CLI as well.
Details
This PR addresses several issues and improvements related to API key handling, session configuration, interactivity checks, and URL handling. Additionally, a refactoring has been performed to enhance code structure and maintainability:
API Key Validation: Previously, the API key was not being validated if the user provided it as a parameter to function. This has been fixed, ensuring that the API key is checked and validated when passed by the user.
Session-specific Configuration: It was previously impossible to configure settings only for the current session without writing them to the configuration file. Now, the configuration values passed during runtime are applied to the current session without being persisted to the config file, unless explicitly specified as configure() param FORCE=TRUE.
Improved is_interactive Check: The is_interactive method previously always returned True. A proper implementation has now been added to accurately determine if the session is interactive (is it terminal, jupiter notebook, google colab etc).
Correct Handling of On-Premise URL: Proper handling for on-premise URLs has been added, ensuring that custom on-premise configurations are correctly processed.
Refactoring and Modularization: The configure function and related methods have been refactored and moved to a separate module to improve code organization and readability.
Unit Tests Update: Unit tests have been updated and moved to reflect the refactoring of the configure module, ensuring comprehensive test coverage and validation of the new structure.
Testing
This PR needs additional testing of configure() function and CLI as well.