module 'aws_cdk.aws_dynamodb' has no attribute 'TableEncryption' - python-3.8

I'm following the aws cdk workshop
The last pytest from the advanced topics
throws:
AttributeError: module 'aws_cdk.aws_dynamodb' has no attribute 'TableEncryption'
What did I miss?
self._table = ddb.Table(
self, 'Hits',
partition_key={'name': 'path', 'type': ddb.AttributeType.STRING},
encryption=ddb.TableEncryption.AWS_MANAGED,
)
.
pip3 freeze | grep dynamodb
aws-cdk.aws-dynamodb==1.23.0

CDK version 1.23.0 didn't have TableEncryption.
It's there in the latest version (1.134.0 as of today). It wasn't there in 1.23.0.
Based on the blame log it was added with https://github.com/aws/aws-cdk/pull/7425. Based on the changelog this PR was merged in for version 1.39.0.
You are on a very old version of CDK. It's a year and a half old. You should upgrade.

Related

dbt- synapse models\example generating error

The problem I’m having is after the profiles.yml All checks passed! (the connection successful)
when i run dbt get this message
Configuration paths exist in your dbt_project.yml file which do not apply to any resources. There are 1 unused configuration paths:- models.dbt_project.example
when I run
dbt --version
Core: - installed: 1.4.1
- latest: 1.4.1 - Up to date!
Plugins: - sqlserver: 1.3.0 - Not compatible!
- synapse: 1.3.2 - Not compatible!
At least one plugin is out of date or incompatible with dbt-core.
You can find instructions for upgrading here:
https://docs.getdbt.com/docs/installation
The error message is telling you what is wrong. There is config in your dbt_project.yml file that does not apply to any files in your models directory.
When you run dbt init, it creates some example models (.sql files) in the models/example directory, like my_first_dbt_model.sql. It also adds some example config to dbt_project.yml that looks like this:
# towards the bottom...
models:
your_project_name:
# Config indicated by + and applies to all files under models/example/
example:
+materialized: view
You need to delete the example key, since you deleted that directory. You could also delete the keys above it, or keep them, since you'll probably add config at some point.
The OTHER error is probably because you installed dbt-core separately from dbt-synapse. You should delete your virtual environment and start over by just running pip install dbt-synapse, which will automatically install a compatible version of dbt-core. You should NEVER pin versions of dbt-core, only the version of your adapter (since the adapter will specify its compatible versions of dbt-core).

Getting error #No module named 'obspy.clients.arclink' in the code for downloading earthquake data

I am trying to download earthquake data and using Obspy and Obspy DMT for the same. I have setup anaconda to work with VS code on Linux. I have created the base anaconda and a separate environment for ob spy. After running the program for earthquake data download, I am getting the error #No module named 'obspy.clients.arclink'. I am new to computational seismology and python in general. Please excuse for any mistakes.
This is the error showing:
ModuleNotFoundError: No module named 'obspy.clients.arclink'
Thank you
obspyDMT works with an older obspy version, you can downgrade via:
pip install obspy==1.2.2

repose.who-friendlyform dependency in TurboGears 2

I am trying to install TurboGear 2. I was following the steps given in this documentation. Link: http://toscawidgets.org/documentation/tw2.core/turbogears.html
On executing this command
pip install -e .
i got this error
No distributions at all found for repose.who-friendlyform>=1.0.4 (from example==0.1dev)
Then with this command
python setup.py develop
i got this error
Searching for repose.who-friendlyform>=1.0.4
Reading https://pypi.python.org/simple/repose.who-friendlyform/
Couldn't find index page for 'repose.who-friendlyform' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for repose.who-friendlyform>=1.0.4
error: Could not find suitable distribution for Requirement.parse('repose.who-friendlyform>=1.0.4')
I tried to install it with easy_install but it didn't work. How can i overcome this error?
The documentation you are pointing to is quite outdated, which TurboGears version are you trying to use? Latest TG versions don't depend on repoze.who-friendlyform anymore. Try to delete your virtualenv, recreate it and then install TurboGears with pip install tg.devtools.
You can find latest TG version documentation on http://turbogears.readthedocs.org/en/latest/#installing-turbogears with a tutorial on using ToscaWidgets at http://turbogears.readthedocs.org/en/latest/cookbook/TwForms.html
Also latest ToscaWidgets documentation has been moved at http://tw2core.readthedocs.org/en/latest/
If you want to experiment with TG2 and Forms there are also a bunch of runnables you can play with: http://runnable.com/TurboGears

Magento Module SQL/Setup Resource File

I updated the SQL file for my module - how do i get it to automatically run again without creating a new version of it?
I am working on my first module and just need to tweak this one so it works on a new install for someone else.
When Magento automatically runs a SQL file for a setup resource, it makes an entry in the core_resource table.
mysql> SELECT code,version,data_version FROM core_resource;
adminnotification_setup 1.0.0 1.0.0
admin_setup 0.7.2 0.7.2
amazonpayments_setup 0.1.2 0.1.2
api_setup 0.8.1 0.8.1
backup_setup 0.7.0 0.7.0
bundle_setup 0.1.11 0.1.11
...
You'll need to remove the single row in this table that corresponds to your module, and then clear your Magento cache. This will let you re-run your setup resource SQL file.
ONLY remove that single row — if you remove rows for the core modules, there will be much breaking and weeping.

How can I upgrade ember-rails' version of ember-data to revision 12?

I've got ember-rails updated to master:
bundle update ember-rails
Updating git://github.com/emberjs/ember-rails.git
Fetching gem metadata from https://rubygems.org/.........
....
Using ember-rails (0.11.1) from git://github.com/emberjs/ember-rails.git (at master)
....
Your bundle is updated!
I'd like to use the latest ember-data revision (12), but every time I update my app's store revision number to 12, i.e.:
App.Store = DS.Store.extend({
revision: 12,
adapter: App.Adapter.create()
});
I see the following error message:
Uncaught Error: Error: The Ember Data library has had breaking API changes since the last time you updated the library. Please review the list of breaking changes at https://github.com/emberjs/data/blob/master/BREAKING_CHANGES.md, then update your store's `revision` property to 11
...and when I check out DS.CURRENT_API_REVISION it's 11:
console.log(DS.CURRENT_API_REVISION); // 11
Is there a way to get the gem to pull in revision 12, or do I have to build ember-data myself and override the included version?
benburton's solution works for what is asked for, but in the latest ember-data it uses an internal method 'readOnly' that was only added to in ember RC2.
Therefore, you need the latest ember in order to run the latest ember-data. The full solution is to simply disregard the second line of your solution, leaving the following:
rails generate ember:install --head
I ended up using ember-rails to generate ember+ember-data and then removing the updated version of Ember like so:
rails generate ember:install --head
rm vendor/assets/ember/development/ember.js vendor/assets/ember/production/ember.js