alteryx / alteryx/promote-python

Username bug when calling predict

Aperta
#19 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Python
Stelle
15
Fork
9
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Currently in the `predict` method the logic is as follows:

```
prediction_url = urllib.parse.urljoin(self.url, os.path.join(
self.username, 'models', modelName, 'predict'))
username = username if username else self.username
response = requests.post(
url=prediction_url,
...
```
The way this logic works is that it builds the prediction url with `self.username` always and never considers if you give the `predict` method a `username` along with the `model` and `data`. It should be switched to look like this:

```
username = username if username else self.username
prediction_url = urllib.parse.urljoin(self.url, os.path.join(
username, 'models', modelName, 'predict'))
```
Unfortunately the repo is read-only so I can not push the change to a remote branch and open a PR. In the short-term I have modified my source code to work as intended.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.