Repository: kedro-org/kedro
Pull request: Expand user home directory (~) for TextLocalDataSet
## Notice

- [x] I acknowledge and agree that, by checking this box and clicking “Submit Pull Request”:

- I submit this contribution under the [Apache 2.0 license](https://www.apache.org/licenses/LICENSE-2.0.txt) and represent that I am entitled to do so on behalf of myself, my employer, or relevant third parties, as applicable.
- I certify that (a) this contribution is my original creation and / or (b) to the extent it is not my original creation, I am authorised to submit this contribution on behalf of the original creator(s) or their licensees.
- I certify that the use of this contribution as authorised by the Apache 2.0 license does not violate the intellectual property rights of anyone else.

## Motivation and Context
Why was this PR created?
Close #19

## How has this been tested?
Followed https://github.com/quantumblacklabs/kedro/blob/master/CONTRIBUTING.md#running-checks-locally

`make test` passed with `498 passed, 8 warnings in 64.13 seconds`
`Required test coverage of 100% reached. Total coverage: 100.00%`


## Checklist

- [x] Read the [contributing](/CONTRIBUTING.md) guidelines
- [x] Opened this PR as a 'Draft Pull Request' if it is work-in-progress
- [x] Updated the documentation to reflect the code changes
- [x] Added new entries to the `RELEASE.md` file
- [x] Added tests to cover my changes
- [x] Assigned myself to the PR
- [x] Added `Type` label to the PR


Problem statement:
User home directory is not expanded for TextLocalDataSet
## Description
User home directory `~` is not automatically expanded for `TextLocalDataSet`, but it is automatically expanded for `ParquetLocalDataSet` and `CSVLocalDataSet `.

## Context
Trying to specify file paths relative to user home directory to simplify interoperability and handoff of Kedro pipelines between teammates - instead of manually replacing hardcoded absolute paths on each machine or user, each user will automatically recreate same directory structure relative to his/her home directory.   

## Steps to Reproduce
```
from kedro.io import TextLocalDataSet
import os


string_to_write = "This will go in a file."

data_set = TextLocalDataSet(filepath="~/code/tmp/new_documentation.md")
data_set.save(string_to_write)

os.path.abspath(data_set._filepath)
```

## Expected Result
`~` should be replaced by user home directory and file should be saved relative to it in subdirectory `code/tmp/`.

## Actual Result
Directory `~/code/tmp/` is created in current working directory.


## Your Environment
Include as many relevant details about the environment in which you experienced the bug:

* Kedro version used (`pip show kedro` or `kedro -V`): v0.14.2
* Python version used (`python -V`): Python 3.6.8 :: Anaconda, Inc.
* Operating system and version: MacOS Mojave 10.14.3

## Checklist
Include labels so that we can categorise your issue:

- [ ] Add a "Component" label to the issue
- [ ] Add a "Priority" label to the issue

Hints from issue discussion:

Commit message: Update RELEASE.md

on branch kalexqb:add_expanduser

Patch to review:
diff --git a/RELEASE.md b/RELEASE.md
index cab292d1bf..74c09105a6 100644
--- a/RELEASE.md
+++ b/RELEASE.md
@@ -2,9 +2,13 @@
 
 ## Major features and improvements
 
+## Bug fixes and other changes
+* Expand user home directory (~) for TextLocalDataSet (see issue #19)
+
 ## Breaking changes to the API
 
 ## Thanks for supporting contributions
+[Alex Kalmikov](https://github.com/kalexqb)
 
 # Release 0.14.2
 
diff --git a/kedro/io/text_local.py b/kedro/io/text_local.py
index 37870b25fa..c5eddc9803 100644
--- a/kedro/io/text_local.py
+++ b/kedro/io/text_local.py
@@ -28,6 +28,7 @@
 """``TextLocalDataSet`` loads and saves data to a local text file. The data is
 accessed text data using the python open function.
 """
+import os
 from pathlib import Path
 from typing import Any, Dict
 
@@ -83,7 +84,7 @@ def __init__(
         default_save_args = {"mode": "w"}
         default_load_args = {"mode": "r"}
 
-        self._filepath = filepath
+        self._filepath = os.path.expanduser(filepath)
         self._load_args = (
             {**default_load_args, **load_args}
             if load_args is not None
diff --git a/tests/io/test_text_local.py b/tests/io/test_text_local.py
index 1057a57b0a..913deef6ba 100644
--- a/tests/io/test_text_local.py
+++ b/tests/io/test_text_local.py
@@ -82,6 +82,9 @@ def test_assess_if_file_exists(self, txt_data_set, sample_text, filepath_txt):
         traditional_write(filepath_txt, sample_text)
         assert txt_data_set.exists()
 
+    def test_filepath_expanduser(self):
+        txt_dataset = TextLocalDataSet(filepath='~')
+        assert '~' not in txt_dataset._filepath
 
 class TestTextLocalDataSetVersioned:
     def test_save_and_load(self, versioned_txt_data_set, sample_text):


Code review comments:
diff_hunk: @@ -82,6 +82,9 @@ def test_assess_if_file_exists(self, txt_data_set, sample_text, filepath_txt):
         traditional_write(filepath_txt, sample_text)
         assert txt_data_set.exists()
 
+    def test_filepath_expanduser(self):
+        txt_dataset = TextLocalDataSet(filepath='~')
+        assert '~' not in txt_dataset._filepath
path: tests/io/test_text_local.py
text: @user1:
```suggestion
        assert '~' not in txt_dataset._filepath  # pylint: disable=protected-access
```