Github user HyukjinKwon commented on a diff in the pull request:

    https://github.com/apache/spark/pull/19665#discussion_r149030792
  
    --- Diff: dev/run-tests.py ---
    @@ -276,9 +276,9 @@ def exec_sbt(sbt_args=()):
     
         sbt_cmd = [os.path.join(SPARK_HOME, "build", "sbt")] + sbt_args
     
    -    sbt_output_filter = re.compile("^.*[info].*Resolving" + "|" +
    -                                   "^.*[warn].*Merging" + "|" +
    -                                   "^.*[info].*Including")
    +    sbt_output_filter = re.compile(b"^.*[info].*Resolving" + b"|" +
    +                                   b"^.*[warn].*Merging" + b"|" +
    +                                   b"^.*[info].*Including")
    --- End diff --
    
    In Python 3:
    
    ```python
    import re
    print(re.compile(b"a").match("a"))
    print(re.compile("a").match("a"))
    print(re.compile("a").match(b"a"))
    print(re.compile(b"a").match(b"a"))
    ```
    
    ```python
    >>> import re
    >>> print(re.compile(b"a").match("a"))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: cannot use a bytes pattern on a string-like object
    >>> print(re.compile("a").match("a"))
    <_sre.SRE_Match object; span=(0, 1), match='a'>
    >>> print(re.compile("a").match(b"a"))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: cannot use a string pattern on a bytes-like object
    >>> print(re.compile(b"a").match(b"a"))
    <_sre.SRE_Match object; span=(0, 1), match=b'a'>
    ```



---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to