Environmental variables missing

For the Building Multimodal Data Piplines course, Lesson 1, code example of Automatic Transcription, OCR, and Semantic Search code. the environment variables are missing. Is there an issue with this session?

I just tried this again and still get errors. Here’s the error msg which seems to be related to environment variables missing: AttributeError: ‘NoneType’ object has no attribute ‘find’

can you post screenshot of the complete error @PzorroS

Here is the full error message: ---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[1], line 19
7 from snowflake.core.table import Table, TableColumn
9 _ = load_dotenv(override=True)
11 session = Session.builder.configs({
12 “account”: os.getenv(“SNOWFLAKE_ACCOUNT”),
13 “user”: os.getenv(“SNOWFLAKE_USER”),
14 “authenticator”: “programmatic_access_token”,
15 “token”: os.getenv(“SNOWFLAKE_PAT”),
16 “role”: os.getenv(“SNOWFLAKE_ROLE”),
17 “warehouse”: os.getenv(“SNOWFLAKE_WAREHOUSE”),
18 “database”: os.getenv(“SNOWFLAKE_DATABASE”),
- → 19 }).create()
21 root = Root(session)
23 DATABASE = os.getenv(“SNOWFLAKE_DATABASE”)

File /usr/local/lib/python3.11/site-packages/snowflake/snowpark/session.py:531, in Session.SessionBuilder.create(self)
529 _add_session(session)
530 else:
- → 531 session = self._create_internal(self._options.get(“connection”))
533 if self._app_name:
534 if self._format_json:

File /usr/local/lib/python3.11/site-packages/snowflake/snowpark/session.py:573, in Session.SessionBuilder._create_internal(self, conn)
570 if “paramstyle” not in self._options:
571 self._options[“paramstyle”] = “qmark”
572 new_session = Session(
- → 573 ServerConnection({}, conn) if conn else ServerConnection(self._options),
574 self._options,
575 )
577 if “password” in self._options:
578 self._options[“password”] = None

File /usr/local/lib/python3.11/site-packages/snowflake/snowpark/_internal/server_connection.py:169, in ServerConnection._init_(self, options, conn)
167 self._lower_case_parameters = {k.lower(): v for k, v in options.items()}
168 self._add_application_parameters()
- → 169 self._conn = conn if conn else connect(**self._lower_case_parameters)
170 self.max_string_size = DEFAULT_STRING_SIZE
171 if self._conn._session_parameters:

File /usr/local/lib/python3.11/site-packages/snowflake/connector/_init_.py:64, in Connect(**kwargs)
62 @wraps(SnowflakeConnection._init_)
63 def Connect(**kwargs) → SnowflakeConnection:
- → 64 return SnowflakeConnection(**kwargs)

File /usr/local/lib/python3.11/site-packages/snowflake/connector/connection.py:688, in SnowflakeConnection._init_(self, connection_name, connections_file_path, **kwargs)
686 kwargs = _get_default_connection_params()
687 self.__set_error_attributes()
- → 688 self.connect(**kwargs)
689 self._telemetry = TelemetryClient(self._rest)
690 self.expired = False

File /usr/local/lib/python3.11/site-packages/snowflake/connector/connection.py:1122, in SnowflakeConnection.connect(self, **kwargs)
1120 logger.debug(“connect”)
1121 if len(kwargs) > 0:
-> 1122 self.__config(**kwargs)
1124 self._crl_config: CRLConfig = CRLConfig.from_connection(self)
1126 no_proxy_csv_str = (
1127 “,”.join(str(x) for x in self.no_proxy)
1128 if (
(…) 1133 else self.no_proxy
1134 )

File /usr/local/lib/python3.11/site-packages/snowflake/connector/connection.py:1714, in SnowflakeConnection.__config(self, **kwargs)
1712 if “account” in kwargs:
1713 if “host” not in kwargs:
-> 1714 self._host = construct_hostname(kwargs.get(“region”), self._account)
1716 logger.info(
1717 f"Connecting to {_DOMAIN_NAME_MAP.get(extract_top_level_domain_from_hostname(self._host), ‘GLOBAL’)} Snowflake domain"
1718 )
1720 # If using a custom auth class, we should set the authenticator
1721 # type to be the same as the custom auth class

File /usr/local/lib/python3.11/site-packages/snowflake/connector/util_text.py:252, in construct_hostname(region, account)
250 else:
251 top_level_domain = “com”
- → 252 if account.find(“.”) > 0 and _is_china_region(account.split(“.”)[1]):
253 top_level_domain = “cn”
254 host = f"{account}.snowflakecomputing.{top_level_domain}"

AttributeError: ‘NoneType’ object has no attribute ‘find’

FYI: I have pinged the Short Course staff on this topic.

Thanks! …Paul

Thank you @PzorroS for taking our course and reporting this.

I just tested L2: Automatic Transcription, OCR, and Semantic Search and in the first code cell got this error.

I reported to the team and extended to our partner, hopefully we’ll get updates/fixes soon. I’ll keep you guys updated in this thread.

Hi everyone!
The issue has been fixed! You can run all notebooks from all lessons now! Be careful to run all code cells in L2 to create the DB that will be used later in L4 and L5.

Happy Learning!


Lesly - DLAI

2 Likes