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

houseplant migrate: 'dict' object has no attribute 'strip' #35

Open
d-ganchar opened this issue Jan 8, 2025 · 0 comments
Open

houseplant migrate: 'dict' object has no attribute 'strip' #35

d-ganchar opened this issue Jan 8, 2025 · 0 comments

Comments

@d-ganchar
Copy link
Contributor

To reproduce:

$ # generate a migration... houseplant generate "create users table"

$ cat ch/migrations/20250109004123_create_users_table.yml

version: "20250109004123"
name: create_users_table
table:

development: &development
  up: |
    CREATE TABLE {table} (
      id UInt64,
      name String
    ) ENGINE = MergeTree()
    ORDER BY id
  down: |
    DROP TABLE {table}

test:
  <<: *development

production:
  up: |
    CREATE TABLE {table} (
      id UInt64,
      name String
    ) ENGINE = MergeTree()
    ORDER BY id
  down: |
    DROP TABLE {table}

Migrate:

$ houseplant migrate

/lib/python3.10/site-packages/houseplant/houseplant.py:112 in migrate_up                                                           │
│                                                                                                                                                                                         │
│   109 │   │   │   │   │   migration = yaml.safe_load(f)                                                                                                                                 │
│   110 │   │   │   │                                                                                                                                                                     │
│   111 │   │   │   │   # Get migration SQL based on environment                                                                                                                          │
│ ❱ 112 │   │   │   │   migration_sql = migration.get(self.env, {}).get("up", {}).strip()                                                                                                 │
│   113 │   │   │   │                                                                                                                                                                     │
│   114 │   │   │   │   table = migration.get("table", "").strip()   
...
AttributeError: 'dict' object has no attribute 'strip'

houseplant: 0.2.2

python: 3.10.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant