Skip to content

[MINOR][PYTHON][DOCS] Make mapInPandas example copy-pastable#41655

Closed
HyukjinKwon wants to merge 1 commit intoapache:masterfrom
HyukjinKwon:minor-doc
Closed

[MINOR][PYTHON][DOCS] Make mapInPandas example copy-pastable#41655
HyukjinKwon wants to merge 1 commit intoapache:masterfrom
HyukjinKwon:minor-doc

Conversation

@HyukjinKwon
Copy link
Member

What changes were proposed in this pull request?

This PR proposes to add one newline into the example of mapInPandas.

Why are the changes needed?

You copy and paste the example:

Screenshot 2023-06-19 at 4 23 25 PM

and it does not work:

>>> def filter_func(iterator):
...     for pdf in iterator:
...         yield pdf[pdf.id == 1]
... df.mapInPandas(filter_func, df.schema).show()
  File "<stdin>", line 4
    df.mapInPandas(filter_func, df.schema).show()
    ^

We should add one more line to match

Does this PR introduce any user-facing change?

Yes, it changes the example of mapInPandas copy-pastable

How was this patch tested?

Manually tested.

@HyukjinKwon
Copy link
Member Author

I already locally checked the build. Merging it in.

Merged to master.

Copy link
Member

@dongjoon-hyun dongjoon-hyun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, LGTM.

czxm pushed a commit to czxm/spark that referenced this pull request Jun 19, 2023
### What changes were proposed in this pull request?

This PR proposes to add one newline into the example of `mapInPandas`.

### Why are the changes needed?

You copy and paste the example:

![Screenshot 2023-06-19 at 4 23 25 PM](https://github.com/apache/spark/assets/6477701/56c4693d-63c8-4858-8324-6bfea6628ef7)

and it does not work:

```
>>> def filter_func(iterator):
...     for pdf in iterator:
...         yield pdf[pdf.id == 1]
... df.mapInPandas(filter_func, df.schema).show()
  File "<stdin>", line 4
    df.mapInPandas(filter_func, df.schema).show()
    ^
```

We should add one more line to match

### Does this PR introduce _any_ user-facing change?

Yes, it changes the example of `mapInPandas` copy-pastable

### How was this patch tested?

Manually tested.

Closes apache#41655 from HyukjinKwon/minor-doc.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
MaxGekk pushed a commit that referenced this pull request Jun 19, 2023
…ewline in all modules

### What changes were proposed in this pull request?

I found that there are many instances same as #41655. This PR aims to address all the examples in all components in PySpark.

### Why are the changes needed?

See #41655.

### Does this PR introduce _any_ user-facing change?

Yes, it changes the documentation and makes the example copy-pastable, see also #41655.

### How was this patch tested?

CI in this PR should validate them. This is logically the same as #41655. I will also build the documentation locally and test.

Closes #41657 from HyukjinKwon/minor-newlines.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
czxm pushed a commit to czxm/spark that referenced this pull request Jun 19, 2023
…ewline in all modules

### What changes were proposed in this pull request?

I found that there are many instances same as apache#41655. This PR aims to address all the examples in all components in PySpark.

### Why are the changes needed?

See apache#41655.

### Does this PR introduce _any_ user-facing change?

Yes, it changes the documentation and makes the example copy-pastable, see also apache#41655.

### How was this patch tested?

CI in this PR should validate them. This is logically the same as apache#41655. I will also build the documentation locally and test.

Closes apache#41657 from HyukjinKwon/minor-newlines.

Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Max Gekk <max.gekk@gmail.com>
@HyukjinKwon HyukjinKwon deleted the minor-doc branch January 15, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments