From a137d4ccda5dbd43bde70629319bbf3a78ff30c4 Mon Sep 17 00:00:00 2001 From: Mohammed Ali Zubair Date: Thu, 25 Apr 2024 09:45:33 -0400 Subject: [PATCH] remove stray print. returning result as shoji.entity --- src/pycrunch/elements.py | 1 - src/pycrunch/importing.py | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/pycrunch/elements.py b/src/pycrunch/elements.py index cb8d61e..c4a3053 100644 --- a/src/pycrunch/elements.py +++ b/src/pycrunch/elements.py @@ -283,7 +283,6 @@ class ElementResponseHandler(lemonpy.ResponseHandler): parsers = {"application/json": parse_json_element_from_response} def status_401(self, r): - print(r.json()) login_url = r.json()["urls"]["login_url"] if r.request.url == login_url: # This means that the requests was made on the login_url, so it was diff --git a/src/pycrunch/importing.py b/src/pycrunch/importing.py index a119d73..82842ec 100644 --- a/src/pycrunch/importing.py +++ b/src/pycrunch/importing.py @@ -80,12 +80,7 @@ def add_schema_metadata(self, site, schema, metadata, filename, fp, mimetype="ap "dataset_id": "None" } ) - return shoji.Entity(site.session, body={ - "status_code": response.status_code, - "payload": response.payload, - "source_url": response.headers.get("Location") - } - ) + return shoji.Entity(self=response.headers.get("Location"), session=site.session).refresh() def add_source(self, ds, filename, fp, mimetype): """Create a new Source on the given dataset and return its URL."""