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

Failed error with manual_override from script_run #47

Closed
astrochun opened this issue Jul 30, 2020 · 2 comments · Fixed by #45
Closed

Failed error with manual_override from script_run #47

astrochun opened this issue Jul 30, 2020 · 2 comments · Fixed by #45
Assignees
Labels
bug Something isn't working scripts Script development

Comments

@astrochun
Copy link
Contributor

This was seen in release/v0.11.0.

             netid                 uaid       portal
1  figshare01-test  T440413500927388672  arts_design
Traceback (most recent call last):
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/ops/__init__.py", line 968, in na_op
    result = expressions.evaluate(op, str_rep, x, y, **eval_kwargs)
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/computation/expressions.py", line 221, in evaluate
    return _evaluate(op, op_str, a, b, **eval_kwargs)
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/computation/expressions.py", line 70, in _evaluate_standard
    return op(a, b)
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/ops/roperator.py", line 13, in rsub
    return right - left
TypeError: unsupported operand type(s) for -: 'set' and 'str'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "requiam/script_run", line 164, in <module>
    ldap_members = mo.identify_changes(ldap_members, portal, 'portal')
  File "/Users/cly/codes/UALibraries/ReQUIAM/requiam/manual_override.py", line 81, in identify_changes
    outside_df['uaid'], 'remove', self.log)
  File "/Users/cly/codes/UALibraries/ReQUIAM/requiam/manual_override.py", line 199, in update_entries
    new_ldap_set = ldap_set - uaid
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/ops/__init__.py", line 1048, in wrapper
    result = na_op(lvalues, rvalues)
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/ops/__init__.py", line 970, in na_op
    result = masked_arith_op(x, y, op)
  File "/Applications/anaconda3/envs/ual-patron-groups/lib/python3.7/site-packages/pandas/core/ops/__init__.py", line 450, in masked_arith_op
    assert is_scalar(y), type(y)
AssertionError: <class 'set'>
@astrochun astrochun added bug Something isn't working scripts Script development labels Jul 30, 2020
@astrochun astrochun self-assigned this Jul 30, 2020
@astrochun astrochun added this to To do in ReDATA Patron Management Software via automation Jul 30, 2020
@astrochun
Copy link
Contributor Author

astrochun commented Jul 30, 2020

The issue stem from handling pandas content. It was fixed by using the to_list() option for the netid and converting the uaid to a set for set operations (addition and removal).

This was fixed in: ad86984

@astrochun astrochun moved this from To do to Needs Review / Testing in ReDATA Patron Management Software Jul 30, 2020
@astrochun astrochun moved this from Needs Review / Testing to In progress in ReDATA Patron Management Software Jul 30, 2020
@astrochun astrochun linked a pull request Jul 30, 2020 that will close this issue
@astrochun
Copy link
Contributor Author

astrochun commented Jul 30, 2020

Test run indicates that it is working as intended. A minor improvement will be needed with log messages.

ReDATA Patron Management Software automation moved this from In progress to Done Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working scripts Script development
Development

Successfully merging a pull request may close this issue.

1 participant