-
Notifications
You must be signed in to change notification settings - Fork 0
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
Load task definition inclusion #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One small comment
entities, outcomes = filter_exclusion(entities, outcomes, exclude_symbols) | ||
if not include_symbols is None: | ||
entities, outcomes = filter_inclusion(entities, outcomes, include_symbols) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This very hard to understand with the double negative logic. lets do:
if exclude_symbols:
if include_symbols:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue that include_symbols could be a series:
import pandas as pd
a = None
b = [1,2,3]
c = pd.Series(b)
if a:
print("None is False")
if b:
print("b is a list ")
if c:
print("series is error ")
will yield
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
/var/folders/xb/f1xjztvd437bvj2g25bkbq3h0000gn/T/ipykernel_19828/782548513.py in ?()
5 if a:
6 print("None is False")
7 if b:
8 print("b is a list ")
----> 9 if c:
10 print("series is error ")
/opt/miniconda3/envs/bmfm/lib/python3.10/site-packages/pandas/core/generic.py in ?(self)
1574 @final
1575 def __nonzero__(self) -> NoReturn:
-> 1576 raise ValueError(
1577 f"The truth value of a {type(self).__name__} is ambiguous. "
1578 "Use a.empty, a.bool(), a.item(), a.any() or a.all()."
1579 )
ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().
We can check it with is instance do you think it will be better?
Something like
from collections.abc import Iterable
if isinstance(the_element, Iterable):
In this PR we added the ability to include a list of symbols for the tasks.