Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7190957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:37:39+00:00 2026-05-28T19:37:39+00:00

I use import avro and etc. for compiling avro schemas in python. Sometimes, my

  • 0

I use import avro and etc. for compiling avro schemas in python. Sometimes, my avro schema will look like:

{ name: "Message1" ..... }

{ name: "Message2", "fields": [ { "type": "Message1", "name": "previous_avro_schema" } ] } ...

Please ignore the typos. I just want to get the message across. The gist is that I have two avro schemas. One of the avro schema use the second avro schema as one of its fields. How do I call avro.schema.parse(....) for such avro messages so that they can be compiled correctly?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:37:40+00:00Added an answer on May 28, 2026 at 7:37 pm

    Avro’s Python support is pretty pathetic, but you can get some stuff to work including multiple schemas at once. You just need to merge the schema files together into one file, and you need to make sure that they are merged in the correct order so dependencies come first, and you need to replace the names with the actual schema This is the script that I use to merge them:

    def resolve(path):
        "fully resolve a schema that includes other schemas"
        data = open(path).read()
        # fill in any while they remain
        while True:
            beg = data.find('`')
            end = data.find('`', beg + 1)
            if beg < 0:
                break
            path = os.path.join(os.path.dirname(path), data[beg+1:end] + '.avsc')
            data = data[:beg] + resolve(path) + data[end+1:]
        return data
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically when I have a python file like: python-code.py and use: import (python-code) the
It is recommended to not to use import * in Python. Can anyone please
If I import and use a single class from another package, will it include
I know of two languages that use import statement: Java and Python. And we
I use Kodingen.com to test python scripts. I would like to install new python
In Python, we can use import to import the names of another namespace into
Using latest JAXB (Sun) and have a hierarchy of schemas that use import directives
In python you can do something like this to import a module using a
A lot of modules I use import entire files into memory or trickle a
'''use Jython''' import shutil print dir(shutil) There is no, shutil.move, how does one move

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.