Skip to content

Commit

Permalink
Fixing export query strings
Browse files Browse the repository at this point in the history
  • Loading branch information
mmerce committed Dec 7, 2023
1 parent 5169ecd commit 73288ee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions bigml/api_handlers/resourcehandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
# Resource types that are composed by other resources
COMPOSED_RESOURCES = ["ensemble", "fusion"]

LIST_LAST = "limit=1;full=yes;tags=%s"
LIST_LAST = "limit=1&full=yes&tags=%s"

PMML_QS = "pmml=yes"

Expand Down Expand Up @@ -948,7 +948,7 @@ def export(self, resource, filename=None, pmml=False,
"text and items fields cannot be "
"exported to PMML.")
if kwargs.get("query_string"):
kwargs["query_string"] += ";%s" % PMML_QS
kwargs["query_string"] += "&%s" % PMML_QS
else:
kwargs["query_string"] = PMML_QS

Expand Down Expand Up @@ -1018,9 +1018,9 @@ def export_last(self, tags, filename=None,
if tags is not None and tags != '':
query_string = LIST_LAST % tags
if project is not None:
query_string += ";project=%s" % project
query_string += "&project=%s" % project

kwargs.update({'query_string': "%s;%s" % \
kwargs.update({'query_string': "%s&%s" % \
(query_string, kwargs.get('query_string', ''))})

response = self._list("%s%s" % (self.url, resource_type),
Expand Down
4 changes: 2 additions & 2 deletions bigml/basemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
# remove them when we use only_model=true so we will set it to
# false until the problem in apian is fixed

ONLY_MODEL = 'only_model=false;limit=-1;'
EXCLUDE_FIELDS = 'exclude=fields;'
ONLY_MODEL = 'only_model=false&limit=-1&'
EXCLUDE_FIELDS = 'exclude=fields&'


def retrieve_resource(api, resource_id, query_string=ONLY_MODEL,
Expand Down

0 comments on commit 73288ee

Please sign in to comment.