Skip to content

Commit 2fb1c95

Browse files
remove excess changes
Signed-off-by: varun-edachali-dbx <varun.edachali@databricks.com>
1 parent bc7ae81 commit 2fb1c95

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

src/databricks/sql/session.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def open(self):
127127
)
128128
self.protocol_version = self.get_protocol_version(self._session_id)
129129
self.is_open = True
130-
logger.info("Successfully opened session " + str(self.guid_hex))
130+
logger.info("Successfully opened session %s", str(self.guid_hex))
131131

132132
@staticmethod
133133
def get_protocol_version(session_id: SessionId):
@@ -149,7 +149,7 @@ def session_id(self) -> SessionId:
149149
return self._session_id
150150

151151
@property
152-
def guid(self):
152+
def guid(self) -> Any:
153153
"""Get the raw session ID (backend-specific)"""
154154
return self._session_id.guid
155155

@@ -160,7 +160,7 @@ def guid_hex(self) -> str:
160160

161161
def close(self) -> None:
162162
"""Close the underlying session."""
163-
logger.info(f"Closing session {self.guid_hex}")
163+
logger.info("Closing session %s", self.guid_hex)
164164
if not self.is_open:
165165
logger.debug("Session appears to have been closed already")
166166
return
@@ -173,13 +173,13 @@ def close(self) -> None:
173173
except DatabaseError as e:
174174
if "Invalid SessionHandle" in str(e):
175175
logger.warning(
176-
f"Attempted to close session that was already closed: {e}"
176+
"Attempted to close session that was already closed: %s", e
177177
)
178178
else:
179179
logger.warning(
180-
f"Attempt to close session raised an exception at the server: {e}"
180+
"Attempt to close session raised an exception at the server: %s", e
181181
)
182182
except Exception as e:
183-
logger.error(f"Attempt to close session raised a local exception: {e}")
183+
logger.error("Attempt to close session raised a local exception: %s", e)
184184

185185
self.is_open = False

src/databricks/sql/types.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,6 @@ def __contains__(self, item: Any) -> bool:
187187
# let object acts like class
188188
def __call__(self, *args: Any) -> "Row":
189189
"""create new Row object"""
190-
191190
if len(args) > len(self):
192191
raise ValueError(
193192
"Can not create Row with fields %s, expected %d values "
@@ -230,15 +229,13 @@ def __reduce__(
230229
self,
231230
) -> Union[str, Tuple[Any, ...]]:
232231
"""Returns a tuple so Python knows how to pickle Row."""
233-
234232
if hasattr(self, "__fields__"):
235233
return (_create_row, (self.__fields__, tuple(self)))
236234
else:
237235
return tuple.__reduce__(self)
238236

239237
def __repr__(self) -> str:
240238
"""Printable representation of Row used in Python REPL."""
241-
242239
if hasattr(self, "__fields__"):
243240
return "Row(%s)" % ", ".join(
244241
"%s=%r" % (k, v) for k, v in zip(self.__fields__, tuple(self))

0 commit comments

Comments
 (0)