shunping commented on code in PR #32594:
URL: https://github.com/apache/beam/pull/32594#discussion_r1792329296
##########
sdks/python/apache_beam/dataframe/transforms_test.py:
##########
@@ -354,6 +354,16 @@ def test_rename(self):
0: 2, 2: 0
}, errors='raise'))
+ def test_dataframe_column_fillna_constant_as_value(self):
Review Comment:
Sorry for the late reply.
The bug only triggered in the transform of DeferredDataFrame, so you have to
put that in a pipeline so that when the pipeline runs the corresponding
transform code path will run.
Could you put a test like the following into frames_test.py?
```python
import numpy as np
import apache_beam as beam
from apache_beam.dataframe import convert
from apache_beam.testing.util import assert_that
from apache_beam.testing.util import equal_to
with beam.Pipeline(None) as p:
pcoll = (p | beam.Create([1.0, np.nan, -1.0]) | beam.Select(x=lambda x: x))
df = convert.to_dataframe(pcoll)
df_new = df['x'].fillna(0)
assert_that(
convert.to_pcollection(df_new),
equal_to([1.0, 0.0, -1.0]))
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]