awslabs / awslabs/amazon-redshift-utils

Mismatch between the analyze and vacuum flag keys and what the code expects

Open
#733 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2.8k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Hello,

I was attempting to use `normalise_config` to sanitize some arguments before passing them
to analyze_vaccum.

After normalising I noticed that a the vacuum_flag and analyze_flag were ignored. I think the issue is here:

```
>>> import vendor.aws_redshift_utils.lib.analyze_vacuum_utility.config_constants as aws_constants
>>> aws_constants.normalise_config
>>> aws_constants.normalise_config({"vacuum_flag": True})
{'do_vacuum': True}
```

https://github.com/awslabs/amazon-redshift-utils/blob/f208c1100370eebca8b38d3e7d0654fb337e3463/src/config_constants.py#L63
the config normalises the keys to "do_vacuum" and "do_analyze",

However as of this PR the analyze_vacuum function expects the config keys to be "vacuum_flag" and "analyze_flag"
https://github.com/awslabs/amazon-redshift-utils/pull/643/files#diff-ae751f79fdff793b5f2a8b6ccd9c63cb84e90931dd1c8a3667146345b481f96eL698

Contributor guide

Open the contributing guide

Research direction

Start with src/config_constants.py and its normalise_config function, then inspect the analyze_vacuum entry point referenced in pull request 643. Trace the normalized vacuum and analyze keys through the call and confirm that both flags are honored consistently; the issue is done when normalised configuration controls the intended operations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
databases
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.