043671c0d80bd0325db86d2a3422e670392bfef1,petastorm/spark/spark_dataset_converter.py,,_check_and_add_scheme,#Any#,22

Before Change


                     Supported schemes: file:///..., /..., hdfs:/...
    :return: A string of the data_url with supported scheme.
    
    if data_url.startswith("/"):
        data_url = "file://" + data_url
    parsed = urlparse(data_url)
    if parsed.scheme not in {"file", "hdfs"}:
        raise NotImplementedError("Scheme {} is not supported.".format(parsed.scheme))
    return parsed.geturl()

After Change


    
    parsed = urlparse(dataset_url)
    if parsed.scheme == "":
        parsed = parsed._replace(scheme="file")  // pylint: disable=protected-access
    if parsed.scheme.lower() not in ["file", "hdfs"]:
        raise NotImplementedError(
            "Scheme {} is not supported.".format(parsed.scheme))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: uber/petastorm
Commit Name: 043671c0d80bd0325db86d2a3422e670392bfef1
Time: 2020-03-12
Author: liang.zhang@databricks.com
File Name: petastorm/spark/spark_dataset_converter.py
Class Name:
Method Name: _check_and_add_scheme


Project Name: streamlit/streamlit
Commit Name: 8144a6cdf9d83d2b1e4bc7492f2fe258fea7eb5e
Time: 2019-04-09
Author: tconkling@gmail.com
File Name: lib/streamlit/proxy/ReportSession.py
Class Name: ReportSession
Method Name: set_run_on_save


Project Name: streamlit/streamlit
Commit Name: a510b8a2c71dabd231c37d8027a251f2f9debc23
Time: 2019-04-22
Author: tconkling@gmail.com
File Name: lib/streamlit/proxy/ReportSession.py
Class Name: ReportSession
Method Name: set_run_on_save