@@ -164,11 +164,12 @@ def create_connector(
164164 This function chooses a configuration in the folowing order:
165165 1. The configuration named by the `name` parameter or `key` parameter
166166 2. The configuration described in the `APERTUREDB_KEY` environment variable.
167- 3. The configuration described in the `APERTUREDB_JSON` environment variable.
168- 4. The configuration described in the `APERTUREDB_JSON` Google Colab secret.
169- 5. The configuration described in the `APERTUREDB_JSON` secret in a `.env` file.
170- 6. The configuration named by the `APERTUREDB_CONFIG` environment variable.
171- 7. The active configuration.
167+ 3. The configuration described in the `APERTUREDB_KEY` Google Colab secret.
168+ 4. The configuration described in the `APERTUREDB_JSON` environment variable.
169+ 5. The configuration described in the `APERTUREDB_JSON` Google Colab secret.
170+ 6. The configuration described in the `APERTUREDB_JSON` secret in a `.env` file.
171+ 7. The configuration named by the `APERTUREDB_CONFIG` environment variable.
172+ 8. The active configuration.
172173
173174 If there are both global and local configurations with the same name, the global configuration is preferred.
174175
@@ -214,6 +215,14 @@ def lookup_config_by_name(name: str, source: str) -> Configuration:
214215 logger .info (
215216 f"Using configuration from APERTUREDB_KEY environment variable" )
216217 config = Configuration .reinflate (data )
218+ elif (data := _get_colab_secret ("APERTUREDB_KEY" )) is not None and data != "" :
219+ logger .info (
220+ f"Using configuration from APERTUREDB_KEY Google Colab secret" )
221+ config = Configuration .reinflate (data )
222+ if create_config_for_colab_secret :
223+ logger .info (
224+ f"Creating and activating configuration from APERTUREDB_KEY Google Colab secret" )
225+ _store_config (config , 'google_colab' )
217226 elif (data := os .environ .get ("APERTUREDB_JSON" )) is not None and data != "" :
218227 logger .info (
219228 f"Using configuration from APERTUREDB_JSON environment variable" )
0 commit comments