-
Notifications
You must be signed in to change notification settings - Fork 586
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
'Unsatisfiable' error when generating a dataframe from rows and columns without a fill value
#2678
Comments
|
Hey @snthibaud - that's a great bug report 😄 It looks like the problem is in providing both rows and columns - if you provide both, they are validated against each other. If you just use columns, the following example works: from hypothesis.extra.pandas import data_frames, indexes, column
from hypothesis import given, strategies as st
@given(
data_frames(
columns=[
column("a", st.just("x"), dtype=str), # note: more specific elements
column("b", st.text(), dtype=str),
],
index=indexes(dtype=int, min_size=1),
)
)
def test(df):
passWe should try to provide a more specific error message for this case though! |
|
Hello @Zac-HD , Thank you! What exactly is meant by 'validated' here? I read this phrase in the same section:
So I assumed that 'a' would be the specified string 'x' and column 'b' would be filled by some other text (provided by text() ). I actually need a Dataframe with columns depending on each other (and I cannot specify all columns for all rows). |
|
When quoting that line I noticed the word 'fill' and it turns out to be a keyword to the 'column' function! Thanks for your help! 😄 |
|
Aha, that would do it! We can definitely provide a better error message though, so I'm keeping the issue open for that 😁 |
rows and columns without a fill value
According to the documentation, absent values should be filled based on the column dtype, but that does not happen. I created the following minimal example of the problem. Any ideas?
The error is:
The text was updated successfully, but these errors were encountered: