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

Dictionary shared arguments break DCP Javascript workload #97

Open
ccmcintyre-kingsds opened this issue Sep 6, 2022 · 0 comments
Open
Labels
bug Something isn't working dcp Relates to DCP or the Compute API javascript Relates to JavaScript or Node.js code python Relates to Python code

Comments

@ccmcintyre-kingsds
Copy link
Contributor

Issue Type

Bug

Source

source

Bifrost Version

0.6.1

Custom Code

No

OS Platform and Distribution

Linux Ubuntu 20.04

Mobile device

No response

Python version

3.8

Current Behaviour?

Keyword arguments, which are an acceptable input format coming from a Pythonic context, are immediately breaking when the work function has been specified as being in javascript. We should be able to handle and proceed with this case; the intended behaviour is to treat them as essentially being positional arguments, for javascript's purposes. Clearly this behaviour as implemented, though, needs at least cursory bugfixing, given the error that even the simple case of it invokes before even reaching job deployment.

Standalone code to reproduce the issue

from bifrost import dcp

work_function = """function workFunction( n, x ){ return n * x }"""

input_set = range(5)
shared_arguments = { "x": 3 }

job = dcp.compute_for(input_set, work_function, shared_arguments)
job.node_js = True

output_set = job.exec()
print(output_set)

Relevant log output

installing dcp-client
Traceback (most recent call last):
  File "issue_js.py", line 11, in <module>
    output_set = job.exec()
  File "/home/chris/anaconda3/lib/python3.8/site-packages/bifrost/dcp/Job.py", line 461, in exec
    results = self.__dcp_run()
  File "/home/chris/anaconda3/lib/python3.8/site-packages/bifrost/dcp/Job.py", line 251, in __dcp_run
    self.work_arguments.append(self.work_key_arguments)
AttributeError: 'Job' object has no attribute 'work_key_arguments'
@ccmcintyre-kingsds ccmcintyre-kingsds added bug Something isn't working dcp Relates to DCP or the Compute API python Relates to Python code javascript Relates to JavaScript or Node.js code labels Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dcp Relates to DCP or the Compute API javascript Relates to JavaScript or Node.js code python Relates to Python code
Projects
None yet
Development

No branches or pull requests

1 participant