Skip to content

Commit

Permalink
[#4801] Consolidate usage of OrderedDict
Browse files Browse the repository at this point in the history
Always import from collections. Remove from ckan.common
  • Loading branch information
amercader committed Dec 20, 2019
1 parent 8c913e2 commit 1167dac
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions ckan/authz.py
Expand Up @@ -3,7 +3,7 @@
import functools
import sys

from collections import defaultdict
from collections import defaultdict, OrderedDict
from logging import getLogger

import six
Expand All @@ -13,7 +13,7 @@

import ckan.plugins as p
import ckan.model as model
from ckan.common import OrderedDict, _, c
from ckan.common import _, c

import ckan.lib.maintain as maintain

Expand Down
5 changes: 0 additions & 5 deletions ckan/common.py
Expand Up @@ -28,11 +28,6 @@

current_app = flask.current_app

try:
from collections import OrderedDict # from python 2.7
except ImportError:
from sqlalchemy.util import OrderedDict


def is_flask_request():
u'''
Expand Down
3 changes: 0 additions & 3 deletions ckan/model/__init__.py
Expand Up @@ -3,13 +3,10 @@
import warnings
import logging
import re
from datetime import datetime
from time import sleep
from os.path import splitext

from six import text_type
from sqlalchemy import MetaData, __version__ as sqav, Table
from sqlalchemy.util import OrderedDict
from sqlalchemy.exc import ProgrammingError

from alembic.command import (
Expand Down
2 changes: 1 addition & 1 deletion ckan/model/domain_object.py
@@ -1,10 +1,10 @@
# encoding: utf-8

import datetime
from collections import OrderedDict

import sqlalchemy as sa
from sqlalchemy import orm
from sqlalchemy.util import OrderedDict

from ckan.model import meta, core

Expand Down
2 changes: 1 addition & 1 deletion ckan/model/resource.py
Expand Up @@ -3,7 +3,7 @@
import datetime

from six import text_type
from sqlalchemy.util import OrderedDict
from collections import OrderedDict
from sqlalchemy.ext.orderinglist import ordering_list
from sqlalchemy import orm
from ckan.common import config
Expand Down
6 changes: 3 additions & 3 deletions ckan/views/group.py
Expand Up @@ -2,11 +2,11 @@

import logging
import re
from six.moves.urllib.parse import urlencode

from collections import OrderedDict

import six
from six import string_types
from six.moves.urllib.parse import urlencode

import ckan.lib.base as base
import ckan.lib.helpers as h
Expand All @@ -17,7 +17,7 @@
import ckan.authz as authz
import ckan.lib.plugins as lib_plugins
import ckan.plugins as plugins
from ckan.common import OrderedDict, g, config, request, _
from ckan.common import g, config, request, _
from flask import Blueprint
from flask.views import MethodView

Expand Down
3 changes: 2 additions & 1 deletion ckanext/datastore/backend/postgres.py
Expand Up @@ -10,6 +10,7 @@
import datetime
import hashlib
import json
from collections import OrderedDict

import six
from six.moves.urllib.parse import (
Expand All @@ -31,7 +32,7 @@

import ckan.model as model
import ckan.plugins as plugins
from ckan.common import config, OrderedDict
from ckan.common import config

from ckanext.datastore.backend import (
DatastoreBackend,
Expand Down

0 comments on commit 1167dac

Please sign in to comment.