From 6afd1391f7cf1b72eebab9bf48c30d77eae61d1e Mon Sep 17 00:00:00 2001 From: Nabeel Date: Tue, 2 Jun 2020 16:02:00 +1000 Subject: [PATCH] Bug fix for REST calls from load script Bug fix for REST call to a model from the load script. --- core/_common.py | 2 +- docker/Dockerfile v.8.1 | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 docker/Dockerfile v.8.1 diff --git a/core/_common.py b/core/_common.py index 4699c6a..0722351 100644 --- a/core/_common.py +++ b/core/_common.py @@ -472,7 +472,7 @@ def _get_rest_response(self, X): payload_header = None if len(self.model['json'].keys()) == 0 else next(iter(self.model['json'])) # Make a REST call for each sample - for i in range(len(X)): + for i in X.index: # Next the JSON payload if required self.model['json'] = dict(X.loc[i,:].astype("str").T) if payload_header is None else {payload_header: dict(X.loc[i,:].astype("str").T)} diff --git a/docker/Dockerfile v.8.1 b/docker/Dockerfile v.8.1 new file mode 100644 index 0000000..8d35218 --- /dev/null +++ b/docker/Dockerfile v.8.1 @@ -0,0 +1,14 @@ +# Use the previous version of qlik-py-tools as a parent image +FROM nabeeloz/qlik-py-tools:8.0 + +# Set the working directory to /qlik-py-tools/core +WORKDIR /qlik-py-tools/core + +# Copy all files from the core subdirectory into the container +COPY ./core/* /qlik-py-tools/core/ + +# Make ports 80 and 50055 available to the world outside this container +EXPOSE 80 50055 + +# Run __main__.py when the container launches +CMD ["python", "__main__.py"] \ No newline at end of file