Skip to content
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

Error in yamltodb after using -N in dbtoyaml #42

Closed
fpuga opened this issue Aug 1, 2012 · 5 comments
Closed

Error in yamltodb after using -N in dbtoyaml #42

fpuga opened this issue Aug 1, 2012 · 5 comments
Labels

Comments

@fpuga
Copy link

fpuga commented Aug 1, 2012

Hi,

I use -N public as argument to exclude public schema in dbtoyaml, as i don't use it in my database and it's fill with postgis functions that introduce noise.

Trying to see the changes with yamltodb i get this error:

Traceback (most recent call last):
  File "/usr/local/bin/yamltodb", line 9, in <module>
    load_entry_point('Pyrseas==0.5.0', 'console_scripts', 'yamltodb')()
  File "/usr/local/lib/python2.7/dist-packages/Pyrseas-0.5.0-py2.7.egg/pyrseas/yamltodb.py", line 56, in main
    stmts = db.diff_map(inmap, args.schlist)
  File "/usr/local/lib/python2.7/dist-packages/Pyrseas-0.5.0-py2.7.egg/pyrseas/database.py", line 289, in diff_map
    self.from_map(input_map, langs)
  File "/usr/local/lib/python2.7/dist-packages/Pyrseas-0.5.0-py2.7.egg/pyrseas/database.py", line 201, in from_map
    self.ndb.schemas.from_map(input_schemas, self.ndb)
  File "/usr/local/lib/python2.7/dist-packages/Pyrseas-0.5.0-py2.7.egg/pyrseas/dbobject/schema.py", line 163, in from_map
    raise KeyError("Expected typed object, found '%s'" % key)
KeyError: "Expected typed object, found 'owner'"

I've tried this but the error is the same

@jmafc
Copy link
Member

jmafc commented Aug 1, 2012

Francisco, as I mentioned before, the master branch is not well tested. I would two things first. If you're using the latest from master, then use dbtoyaml -Ox to create the YAML output (i.e., exclude owner and privilege information, which are the latest features added). Alternatively, use either tag v0.5.0 or checkout commit ecc4689 if you'd prefer something more recent.

@jmafc
Copy link
Member

jmafc commented Aug 22, 2012

Francisco, do you have an update to this?

@jmafc
Copy link
Member

jmafc commented Aug 29, 2012

Francisco, I just realized that the -N/--exclude-schema option to dbtoyaml, not to yamltodb.

If I try to use -N, e.g., yamltodb -N public newdb spec.yaml, I get:

yamltodb.py: error: argument spec: can't open 'newdb': [Errno 2] No such file or directory: 'newdb'

If I place the option at the end, e.g., yamltodb newdb spec.yaml -N public, I get:

yamltodb.py: error: unrecognized arguments: -N public

The point is: I don't get very far into yamltodb either way. Now I also tried using -N in dbtoyaml, in a database that had both a schema s1 and the public schema (with a couple of objects each) and piped the output to yamltodb, but it processed it without errors, i.e., it created s1 and its objects.

Coincidentally, we now have issue #43, which looks similar to yours, but I need more information from one or both of you in order to be able to reproduce and resolve the issue.

@jmafc
Copy link
Member

jmafc commented Sep 5, 2012

Francisco, I believe change 0052e8a will fix the error you were seeing, so I'm inclined to close this issue. However, if you want to explore adding a -N option to yamltodb, we could add another issue (or change the title of this one) (hablo español, si te es más fácil).

@jmafc
Copy link
Member

jmafc commented Oct 8, 2012

Closing as I believe this has been fixed and there has been no response from Francisco.

@jmafc jmafc closed this as completed Oct 8, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants