[ 
https://issues.apache.org/jira/browse/AVRO-3622?focusedWorklogId=804783&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-804783
 ]

ASF GitHub Bot logged work on AVRO-3622:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 30/Aug/22 10:50
            Start Date: 30/Aug/22 10:50
    Worklog Time Spent: 10m 
      Work Description: perj commented on code in PR #1843:
URL: https://github.com/apache/avro/pull/1843#discussion_r958322538


##########
lang/py/avro/test/test_compatibility.py:
##########
@@ -659,6 +688,7 @@ def test_schema_compatibility(self):
                 ENUM_ABC_FIELD_DEFAULT_B_ENUM_DEFAULT_A_RECORD,
             ),
             (NS_RECORD1, NS_RECORD2),
+            (WITHOUT_NAMESPACE_RECORD, WITH_NAMESPACE_RECORD),

Review Comment:
   Feel free to ignore this as I'm not too familiar with this code, but are 
these two really compatible? To me, it reads like one of them has the null 
namespace and the other one has the namespace "ns". Don't namepaces have to 
match to be compatible?
   
   I'd expect `{"namespace":"ns","name":"Record"}` to be compatible with 
`{"name":"ns.Record"}` but not too sure about if that's compatible with 
`{"name":"Record"}`. But like I said, I'm not an expert on Avro.



##########
lang/py/avro/test/test_schema.py:
##########
@@ -629,6 +641,10 @@ def test_invalid_name(self):
             None,
             None,
         )
+        # A name cannot start with dot."

Review Comment:
   A few lines later, the spec says:
   
   > The null namespace may not be used in a dot-separated sequence of names.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 804783)
    Time Spent: 50m  (was: 40m)

> Python compatibility check fails if record with and without namespace are 
> compared
> ----------------------------------------------------------------------------------
>
>                 Key: AVRO-3622
>                 URL: https://issues.apache.org/jira/browse/AVRO-3622
>             Project: Apache Avro
>          Issue Type: Bug
>          Components: python
>    Affects Versions: 1.11.1
>            Reporter: Jarkko Jaakola
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> Avro spec:
> {noformat}
>  To match, one of the following must hold:
> ...
>   * both schemas are records with the same (unqualified) name{noformat}
> Following records are compatible. The `ReaderWriterCompatibilityChecker` 
> reports name mismatch and an incompatibility. Similar test case with Java 
> implementation passes.
> {code:java}
> WITHOUT_NAMESPACE_RECORD = parse(
>     json.dumps(
>         {
>             "type": SchemaType.RECORD,
>             "name": "Record1",
>             "fields": [
>                 {
>                     "name": "f1",
>                     "type": "int",
>                 }
>             ],
>         },
>     )
> )
> WITH_NAMESPACE_RECORD = parse(
>     json.dumps(
>         {
>             "type": SchemaType.RECORD,
>             "name": "ns.Record1",
>             "fields": [
>                 {
>                     "name": "f1",
>                     "type": "int",
>                 }
>             ],
>         },
>     )
> )
>  
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to