Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Axon eval(hisClear) requires POST, not GET with skyspark #110

Open
clarsen opened this issue Jun 10, 2021 · 3 comments
Open

Axon eval(hisClear) requires POST, not GET with skyspark #110

clarsen opened this issue Jun 10, 2021 · 3 comments

Comments

@clarsen
Copy link

clarsen commented Jun 10, 2021

session.get_eval( 'hisClear(parseRef("p:dataCenter50B:r:282c63c3-f1e7d0c0"), 2021)' )

results in

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pyhaystack-3.0.0-py3.8.egg/pyhaystack/client/http/sync.py", line 78, in _request
  File "/usr/local/lib/python3.8/site-packages/requests-2.25.1-py3.8.egg/requests/models.py", line 943, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 405 Client Error: GET not allowed for op 'eval' for url: https://skysparkhost.xxx.yyy/api/dataCenter50B/eval?expr=hisClear(parseRef(%22p:dataCenter50B:r:282c63c3-8655c4e7%22),%202021)

with fix of using _post_grid:

class EvalOpsMixin(object):
    def post_eval(self, arg_expr):
        url = "eval"
        eval_grid = hszinc.Grid()
        eval_grid.column["expr"] = {}
        eval_grid.append({"expr": arg_expr})
        return self._post_grid(url, eval_grid, callback=lambda *a, **k: None)

results in

<Grid>
        Version: 3.0
        Columns:
                id
                dis
                numRemoved
        Row    0:
        id=Ref('p:dataCenter50B:r:282c63c3-f1e7d0c0', '91 onicon  Return Temperature', True)
        dis='91 onicon  Return Temperature'
        numRemoved=1918.0
</Grid>

if this looks acceptable, i can submit a PR...

@ChristianTremblay
Copy link
Owner

Can you try develop branch ? We've made a post_eval version few months ago

@jdkaire
Copy link

jdkaire commented Mar 28, 2022

@ChristianTremblay I see the code is still in the develop branch. @clarsen can you submit the PR?
Thanks!

@Rinke-beep
Copy link

Are there any updates on this issue? I am still having the above mentioned 405 errors using pyhaystack 3.0.0?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants