-
Notifications
You must be signed in to change notification settings - Fork 29.3k
[SPARK-25345][ML] Deprecate public APIs from ImageSchema #22349
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
Changes from 4 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,7 @@ | |
| from pyspark import SparkContext | ||
| from pyspark.sql.types import Row, _create_row, _parse_datatype_json_string | ||
| from pyspark.sql import DataFrame, SparkSession | ||
| import warnings | ||
|
|
||
| __all__ = ["ImageSchema"] | ||
|
|
||
|
|
@@ -207,6 +208,9 @@ def readImages(self, path, recursive=False, numPartitions=-1, | |
| .. note:: If sample ratio is less than 1, sampling uses a PathFilter that is efficient but | ||
| potentially non-deterministic. | ||
|
|
||
| .. note:: Deprecated in 2.4.0. Use `spark.read.format("image").load(path)` instead and | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would it make sense to issue a warning when people call this code path (e.g.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added. |
||
| this `readImages` will be removed in 3.0.0. | ||
|
|
||
| :param str path: Path to the image directory. | ||
| :param bool recursive: Recursive search flag. | ||
| :param int numPartitions: Number of DataFrame partitions. | ||
|
|
@@ -222,7 +226,8 @@ def readImages(self, path, recursive=False, numPartitions=-1, | |
|
|
||
| .. versionadded:: 2.3.0 | ||
| """ | ||
|
|
||
| warnings.warn("`ImageSchema.readImage` is deprecated. " + | ||
| "Use `spark.read.format(\"image\").load(path)` instead.") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| spark = SparkSession.builder.getOrCreate() | ||
| image_schema = spark._jvm.org.apache.spark.ml.image.ImageSchema | ||
| jsession = spark._jsparkSession | ||
|
|
||
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.
Technically builtin package should be ordered above per PEP 8. I wonder why this is not caught.