graphql-python / graphql-python/graphene-sqlalchemy

MySQL Enum reflection convertion issue

オープン
#148 コメント 0 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
985
フォーク
223
PR マージ指標
30日以内にマージされた PR はありません

説明

When using reflection to build the models (instead of declarative) the Enum conversion fails because the ENUM column is treated as string so doing ```type.name``` returns None.

```sql
CREATE TABLE `foos` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`status` ENUM('open', 'closed') DEFAULT 'open',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
```

```python
class Foo(Base):

__table__ = Table('foos', metadata, autoload=True)

```

```shell
enum_class = super(EnumMeta, metacls).__new__(metacls, cls, bases, classdict) TypeError: Error when calling the metaclass bases type() argument 1 must be string, not None
```

Suggested [fix](https://github.com/graphql-python/graphene-sqlalchemy/pull/147)

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。