File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -167,16 +167,23 @@ def __new__(
167167 raise ValueError (
168168 "Proxy config is required when reader is built from config"
169169 )
170+ assert (
171+ spark is not None
172+ ) # set in "reader is None or writer is None" branch
173+ assert config .reader_config is not None # ensured by branch condition
170174 proxy_init = config .proxy_config .to_object (spark )
171175
172- reader_init = config .reader_config .to_object (spark ) # type: ignore
176+ reader_init = config .reader_config .to_object (spark )
173177 else :
174178 reader_init = reader
175179 if proxy is not None :
176180 proxy_init = proxy
177181 elif config .proxy_config is None :
178182 raise ValueError ("Proxy config is required when reader is provided" )
179183 else :
184+ assert (
185+ spark is not None
186+ ) # set in "both provided; proxy from config" branch
180187 proxy_init = config .proxy_config .to_object (spark )
181188 if config .writer_config is None and writer is None :
182189 raise ValueError (
@@ -185,7 +192,9 @@ def __new__(
185192 elif writer is None or (
186193 config .writer_config is not None and config .writer_config .force
187194 ):
188- writer_init = config .writer_config .to_object (spark ) # type: ignore
195+ assert spark is not None # set when reader or writer from config
196+ assert config .writer_config is not None # ensured by branch condition
197+ writer_init = config .writer_config .to_object (spark )
189198 else :
190199 writer_init = writer
191200 cls ._instance ._reader = reader_init
Original file line number Diff line number Diff line change @@ -192,8 +192,6 @@ def from_available(cls, profile: str = "default") -> Credentials:
192192 Raises:
193193 ValueError: If no credentials are found in any source
194194 """
195- # print(f"Chuy profile: {profile}")
196-
197195 # Check environment variables first
198196 if os .environ .get ("SFDC_LOGIN_URL" ):
199197 logger .debug ("Loading credentials from environment variables" )
You can’t perform that action at this time.
0 commit comments