Options
create_default_options_builder()
¶
Creates an options builder with some sensible default options set. This is deliberately pretty slim (just the minimum required options are set). Use vds_update_options to make modifications.
Returns:
| Type | Description |
|---|---|
ParsingOptionsBuilder
|
a ParsingOptionsBuilder instance |
Source code in ckanext/versioned_datastore/lib/importing/options.py
79 80 81 82 83 84 85 86 87 88 89 90 | |
get_options(resource_id, version=None)
¶
Retrieves the resource's parsing options that apply for the given version. If the version is None, returns the latest options.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_id
|
str
|
the resource ID |
required |
version
|
Optional[int]
|
optional version which, if passed, will mean the options returned are the options that would be available at the given version. |
None
|
Returns:
| Type | Description |
|---|---|
Optional[ParsingOptions]
|
a ParsingOptions instance or None if no parsing options are in use |
Source code in ckanext/versioned_datastore/lib/importing/options.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
update_options(resource_id, overrides=None)
¶
Update the options for the given resource using the overrides if given. If no options are set on the resource then some default ones are created and added.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
resource_id
|
str
|
the resource ID |
required |
overrides
|
Optional[dict]
|
any override options to set |
None
|
Returns:
| Type | Description |
|---|---|
Optional[int]
|
the new options version that has been committed or None if nothing was changed |
Source code in ckanext/versioned_datastore/lib/importing/options.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | |