Skip to content

Commit

Permalink
Fix pytests
Browse files Browse the repository at this point in the history
  • Loading branch information
SumanMaharana committed Nov 22, 2024
1 parent 9aa914f commit f4fd8f7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 2 additions & 4 deletions ingestion/src/metadata/ingestion/ometa/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,9 @@ def _one_request(self, method: str, url: URL, opts: dict, retry: int):
resp = self._session.request(method, url, **opts)
resp.raise_for_status()

# resp.status_code: 204 => True when request call is successful with no content returned
# the content is passed through resp.headers
if resp.text != "" or resp.status_code == 204:
if resp.text != "":
try:
return resp.json() if resp.text != "" else resp
return resp.json()
except Exception as exc:
logger.debug(traceback.format_exc())
logger.warning(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,12 @@ def _set_api_session(self) -> bool:
"""
Set the user api session to active this will keep the connection alive
"""
api_session = self.client.put(path="/sessions")
api_session = requests.put(
url=self._get_base_url("sessions"),
headers=self.auth_params.auth_header,
cookies=self.auth_params.auth_cookies,
timeout=60,
)
if api_session.ok:
logger.info(
f"Connection Successful User {self.config.username} is Authenticated"
Expand Down

0 comments on commit f4fd8f7

Please sign in to comment.